Auto increment build number by run script. (Xcode)

Posted on

1. to add key in your Project-info.plist
CFBuildNumber, CFBuildDate
2. add scripts to your run script (in Xcode)
CFBuildNumber=$(/usr/libexec/PlistBuddy -c “Print CFBuildNumber" $myPlist)
CFBuildNumber=$(($CFBuildNumber + 1))
/usr/libexec/PlistBuddy -c “Set :CFBuildNumber $CFBuildNumber" $myPlist
/usr/libexec/PlistBuddy -c “Set :CFBuildDate $CFBuildDate" $myPlist
echo “build number: " $CFBuildNumber

3. get info from Project-info.plist and show on somewhere.
NSString * version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
NSString * buildNo = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBuildNumber"];
NSString * buildDate = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBuildDate"];

Can’t debug iOS 4.2 with iPodTouch 3G in Xcode 4.3

Posted on

This is regards to debug by Xcode 4.3 and attempting to run on an earlier device (e.g. iPhone 3G, 2G, iPod 1st gen, etc)
Solution: Remove ‘Required Device Capabilities’ in XXXX-info.plist if wanting to support devices that run armv6 (e.g. the iPhone 3G).

instruments remote exception encountered

Posted on

make sure your Xcode set the Profile scheme as Debug than Release.