Search code examples
iosxcodegitpost-commitagvtool

(iOS, XCode 4.2) Setting bundle version using Git post-commit hook causes my project to turn into a Mac project


I've decided to start versioning my project "the Apple way," using "Bundle versions string, short" for the "marketing version" (i.e. 2.0.1) of my project, and "Bundle version" as a build number (e.g. 42).

To that end I've added a Git post-commit hook to call agvtool next-version -all. This does in fact work -- Info.plist is being properly updated with an incrementing version number.

However it also has the unfortunate side effect of apparently converting my iOS project into a Mac project -- iOS device, iPhone 5.0 simulator, etc. disappears from my Scheme menu to be replaced with a single entry, My Mac 64-bit. Fortunately this change appears to be temporary, as quitting and relaunching Xcode brings back the missing iOS scheme entries.

Am I doing this wrong? Is there a better way of accomplishing my goals? Or have I run up against a weird bug in Xcode?


Solution

  • I'm having exactly the same problem, but instead of relaunching Xcode I'm just re-selecting Deployment Target in Summary tab in target options. This is much faster.