21

In Xcode 4, when I'm working when an iOS project, the Scheme drop down menu in Xcode's toolbar normally displays a scheme for iPhone X.X Simulator, iPad X.X Simulator and iOS Device.

When changing branches after having done something that affects the *.xcodeproj/project.pbxproj file, all my schemes disappear from the scheme drop down. If I close the project and reopen it, they come back. This is extremely annoying.

Here's what I'm doing:

  • Create a new iOS related project
  • Stage + Commit everything in the master branch
  • Create & switch to a new branch
  • Add a new class to your project and Save All (CMD+S+option) or just build the project to save everything.
  • Commit that change
  • Switch back to the master branch

At this point, my schemes are screwed and I have to close the project and reopen it to get them back.

Here's what they look like at the beginning: enter image description here

Here's what they look like after following the steps I listed: enter image description here

Does anyone know of a way around this or is this just a bug in Xcode? I submitted a bug report to Apple about it months ago and have not received a response. I've also received no response to a question about it in the developer forums.

Update: If you have a project with multiple targets, only the schemes for the selected target get screwed up after switching branches.

Update: Here's my .gitignore

# the build
build

# temp nibs and swap files
*~.nib
*.swp

# OS X folder attributes
.DS_Store

# user-specific XCode stuff
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/
Cœur
  • 37,241
  • 25
  • 195
  • 267
George
  • 1,940
  • 18
  • 27
  • Same problem here, anything that changes the pbxproj will screw up the schemes. – Pascal Dec 02 '11 at 19:19
  • @Pascal do those files NEED to be versioned? I'm not familiar with XCode, but I'd think it might not like the caching or something. – Nic Dec 02 '11 at 19:25
  • 3
    @melee Yes, the pbxproj file needs to be versioned. – George Dec 02 '11 at 20:55
  • Is there any line needed to be cleaned up in that files? (http://stackoverflow.com/questions/6064476/xcode4-project-utility-to-clean-up-pbxproj-file) or any conversion taking place that you could prevent? (http://stackoverflow.com/questions/1549578/git-and-pbxproj)? – VonC Dec 04 '11 at 10:12
  • 1
    This sounds like a bug in Xcode. Have you filed a bug with Apple yet at http://bugreporter.apple.com? – Joey Hagedorn Dec 23 '11 at 05:34
  • @Joey yeah, months ago unfortunately. – George Dec 23 '11 at 12:17
  • 1
    This happens everytime. It's most certainly a bug. I just click in the build target version box (5.0, etc) and then out again and it resets itself. – Dylan Gattey Dec 23 '11 at 22:39
  • @Dylan Works for me too, that's better than closing/opening the project! – George Dec 29 '11 at 13:58

2 Answers2

2

This happens every time for me. It's most certainly a bug. I just click in the build target version box (5.0, etc) and then out again and it resets itself. No need to open and close the project.

Dylan Gattey
  • 1,713
  • 13
  • 34
  • Can you explain what you mean? This is happening to me in xcode 6.0.1 and I have no idea how to fix it without recreating all my schemes every time. – emma ray Sep 24 '14 at 13:57
0

Are you adding and committing the .xcodeproj file? I had a similar question here about how to manage the configuration with branches. I think both of the answers may be helpful.

Community
  • 1
  • 1
Jim
  • 5,940
  • 9
  • 44
  • 91