Monday, January 30, 2012
Thursday, March 10, 2011
Sunday, February 27, 2011
Tuesday, January 18, 2011
Display info.plist in program
NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSLog(@"%i Keys: %@ ", [infoDictionary count],
[[infoDictionary allKeys] componentsJoinedByString: @" ,"]);
UIDeviceFamily ,CFBundleInfoPlistURL ,DTPlatformName ,LSRequiresIPhoneOS ,CFBundleVersion ,
CFBundleIdentifier ,CFBundleSignature ,CFBundleExecutable ,CFBundleExecutablePath ,CFBundleDisplayName ,CFBundleName ,CFBundleIconFiles ,
CFBundleSupportedPlatforms ,CFBundlePackageType ,NSBundleResolvedPath ,DTCompiler ,CFBundleInfoDictionaryVersion ,prefix ,CFBundleIconFile ,
CFBundleResourceSpecification ,DTXcodeBuild ,DTPlatformBuild ,DTXcode ,
MinimumOSVersion ,NSBundleInitialPath ,DTPlatformVersion ,UIStatusBarHidden ,UIPrerenderedIcon ,DTSDKName ,CFBundleDevelopmentRegion
Every other time, my build will fail with
"Command /usr/bin/codesign failed with exit code 1" as the error.
However, the second time it will succeed.
This is the details of the error
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: x" "--resource-rules=/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app/ResourceRules.plist" --entitlements "/Users/x/Documents/x/three20/xx/build/template.build/Release-iphoneos/x.build/x.xcent" "/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app"
/Users/x/Documents/x/three20/x/build/Release-iphoneos/x.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
While the second time when it succeeds, it has the following warning:
[WARN]Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'.
"Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'.
After hours' search, there are NO other good posts talking about this. Many people asked this question, but no good answer found.
I tried myself many different ways and finally, I know why!!
This is because Info.plist includes self as target.
Then how to fix????