How to set default scheme for workspace in Xcode?

I have a workspace in Xcode with about 10 circuits.

Whenever I clone a repository and open the Xcode workspace from a newly cloned repository for the first time, the selected scheme is always the first scheme that I created when I first developed the Xcode workspace. Since then, I have added about 9 additional schemes.

I would like the default schema to be selected when the Xcode project is first opened from the recently cloned repository to be a different schema.

Note that Set Default Schema for an Xcode project does not answer this question, despite the promising title. I cannot find this question, asked or answered, anywhere else.

How to set default scheme in Xcode project?

+4
source share
1 answer

I delved into this and found at least part of the answer. Hope this helps. I do not work with the workspace, but I work with a project with several subprojects and schemes.

The selected project diagram is a user-specific configuration, and it seems that it cannot be added to the new user who is cloning the repository. I can tell by looking at my git repository after changing the settings stored in

<projectname>.xcodeproj/project.xcworkspace/xcuserdata/<username>.xcuserdatad/UserInterfaceState.xcuserstate

So, if we canโ€™t set the selected circuit, can we set the order so that the desired circuit is displayed at the top? It seems not, because even for general schemes, information about ordering a scheme is placed in a user-specific file:

<projectname>.xcodeproj/xcuserdata/<username>.xcuserdatad/xcschemes/xcschememanagement.plist

It was as much as possible, but I believe that there should be a way, even if it is a little hacked. The project preserves the order that you created the schemes in some way, possibly in the project.pbxproj file. Therefore, perhaps a small reformatting of this file may produce some results.

+4
source

Source: https://habr.com/ru/post/1491202/


All Articles