Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the default scheme for Xcode project

Tags:

xcode

I have an Xcode project MyApp (with 1 target MyApp), that includes another project LibProject (with 2 targets, lib and app). I have autocreate schemes selected in the Xcode ui, and when I first open the project it does indeed create the schemes but one of the schemes from the nested LibProject is selected whereas I want the single target/scheme from MyApp to be selected. I can change the scheme after the fact and the UI remembers, but I don't want to have Xcode default to an incorrect scheme.

The order the schemes end up:

lib (*with this one selected)
app
MyApp  

Any idea how to select the default for newly created schemes?

like image 284
rooftop Avatar asked Oct 17 '12 21:10

rooftop


2 Answers

I had exactly this problem. We have three projects in one workspace, one of which is dependent on the other two. To build everything, we build the main project, but, somewhat, but not provably, around the time we switched to Xcode 6, the scheme which came up when we pulled would be one of the subsidiary projects. Even if we changed it to the main project, it would revert with every pull from git. So, I knew that this was not a user setting which controlled it, but something hidden in a common file, since our user settings file are not in our git repo.

I managed to change it back for our workspace. I did three things:-

Firstly I reordered some file in the main project, just in case it was some hidden project setting, but that did not work;

Then I noticed that the top-level project was set to build in parallel, so I set that to not do so, since it does require the output of the other two projects to link. Xcode actually manages this fine, but it was a way to force a change in the scheme file. This did not appear to fix it either;

My third change was to delete and re-add the subsidiary projects in the workspace; I also reversed the order of the two subsidiary projects. This final change did make the main project's scheme appear for other users, so I believe is the way to do it.

I listed the other items in case it turns out that this is not just one step and I got lucky due to the earlier attempts.

like image 110
Simon H Avatar answered Sep 22 '22 09:09

Simon H


Have you tried the the Edit Scheme... or New Scheme... or Manage Schemes... in the Product menu of Xcode. You should be able to edit the scheme to what you want and Xcode will remember it for the project.

enter image description here

like image 41
wigging Avatar answered Sep 21 '22 09:09

wigging