Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recreate_user_schemes produces invalid schemes for Xcode 6.3 #264

Open
jrabek opened this issue Apr 15, 2015 · 3 comments
Open

recreate_user_schemes produces invalid schemes for Xcode 6.3 #264

jrabek opened this issue Apr 15, 2015 · 3 comments
Milestone

Comments

@jrabek
Copy link

jrabek commented Apr 15, 2015

This was observed using a cmake generated xcodeproj which was then used to generate schemes using the following script:

#!/usr/bin/env ruby
require 'xcodeproj'
xcproj = Xcodeproj::Project.open("build/xcode-ios/project.xcodeproj")
xcproj.recreate_user_schemes
xcproj.save

After running the script and then opening Xcode, Xcode created a new set of schemes. Running xcodebuild from the command line referencing the Xcodeproj schemes fails reporting an unknown scheme error.

Fixing this bug would enable using cmake to generate an xcode project from the command line and then building and packaging the app without having to open xcode. Opening xcode is necessary now to generate the scheme files (http://www.cmake.org/Bug/view.php?id=15441). We wanted to use Xcodeproj to avoid this in our continuous builder.

The changes between the xcode generated schemes and the Xcodeproj generated schemes seem to be

  1. LastUpgradeVersion is now 0630
  2. The LaunchAction section now has a MacroExpansion section.
      <MacroExpansion>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "5C4260AEFBD6437C84C01A95"
            BuildableName = "libmylib.a"
            BlueprintName = "mylib"
            ReferencedContainer = "container:build/xcode-ios/project.xcodeproj">
         </BuildableReference>
      </MacroExpansion>
  1. The container path in ReferencedContainer is now prefixed with one more level of directory (i.e. build/xcode-ios/project.xcodeproj vs xcode-ios/project.xcodeproj)
  2. xschememanagement.plist now has orderHint:
        <key>ALL_BUILD.xcscheme</key>
        <dict>
            <key>isShown</key>
            <true/>
            <key>orderHint</key>
            <integer>3</integer>
        </dict>
  1. xschememanagement.plist now has keys referring to the scheme file:
<key>myscheme.xcscheme</key>
  1. xschememanagement.plist now fills in the SuppressBuildableAutocreation section
<key>SuppressBuildableAutocreation</key>
    <dict>
        <key>004378C5206542DBBF7A4310</key>
        <dict>
            <key>primary</key>
            <true/>
        </dict>
@jrabek
Copy link
Author

jrabek commented Apr 17, 2015

For others looking to generate an archive from the command line using xcodebuild, this change (hack) seems to be enough: airtimemedia@2f0bfc6. This is not a full fix for this issue by any means.

Xcode won't use the schemes in Xcode, but for archiving purposes in xcodebuild they seem to be good enough.

@kylef kylef modified the milestone: 1.0.0 May 8, 2015
@mr-kelly
Copy link

Now 2016/04/13, I still see confuse with this problem

@jakemumu
Copy link

Was there ever a solution to this which didn't involve a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants