xcodebuild -list 找不到已存在的方案
我有xcode项目,我想在命令行下构建这个项目,这个项目由很多子项目组成,首先我将这些源文件获取到本地磁盘,我使用 xcodebuild -list 来查找方案,我找不到任何东西,而之后我用xcode手动打开这个项目,然后使用xcodebuild -list 查找scheme,可以看到一些scheme。
我比较了这两个场景的项目文件,对于第二个项目,存在xcuserdata文件夹,所以我可以找到方案,我需要使用方案来构建这个项目的问题。
任何建议将不胜感激。
I have xcode project, I want to build this project under command line, this project composed many sub-project, first I fetch these source files to local disk, I use xcodebuild -list to find scheme, I can not find anything, while after I manually open this project with xcode and then use xcodebuild -list to find scheme, some scheme can be seen.
I compare the project file of these two scenario, for the second project, there existed xcuserdata folder, so I can find the scheme, the problem I need use scheme to build this project.
Any suggestion will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现,要使
-scheme
构建正常工作,您需要在.xcodeproj
目录中放置project.xcworkspace/
目录。project.xcworkspace/
目录中应包含一个contents.xcworkspacedata
文件。就我而言,
project.xcworkspace/
目录不是 git 存储库,因为以前不需要它,所以我的中有
*.xcworkspace
。 gitignore 文件。I've found that for
-scheme
builds to work correctly you need to have theproject.xcworkspace/
directory in place within the.xcodeproj
directory. Theproject.xcworkspace/
directory should have acontents.xcworkspacedata
file within it.In my case, the
project.xcworkspace/
directory wasn't it the git repository because it wasn't previously necessary so I had*.xcworkspace
in my.gitignore
file.检查文件 .xcodeproj/xcuserdata/.xcuserdatad/xcschemes 是否存在,如果没有打开 *.xcodeproj 并且该文件将由 xcode 创建,然后从 xcodebuild -list 获取当前的方案
check the file .xcodeproj/xcuserdata/.xcuserdatad/xcschemes exists,if not open *.xcodeproj and the file will be created by xcode,then get the current Schemes from xcodebuild -list