ios 为什么 Xcode 4 不创建任何产品?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5331270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why doesn't Xcode 4 create any products?
提问by Tiki
Regardless of build configuration, building my iPad app does not actually output a .app file. It does run in the iPad simulator and on a device, but when I hit build or build and run, the binary appears under Products in red and is not created in the "build" folder as designated in build settings.
无论构建配置如何,构建我的 iPad 应用程序实际上都不会输出 .app 文件。它确实在 iPad 模拟器和设备上运行,但是当我点击构建或构建并运行时,二进制文件以红色显示在产品下,而不是在构建设置中指定的“构建”文件夹中创建。
Any ideas?
有任何想法吗?
回答by Jason Coco
Xcode 4 places its build products and other intermediaries/temporary files/indexes in a derived data directory now instead of a "build" directory that is mixed in with your product files. It does this to deal with the new workspaces and also so that you can have clean builds of different projects in different workspaces without contaminating each other.
Xcode 4 现在将其构建产品和其他中间件/临时文件/索引放在派生数据目录中,而不是与您的产品文件混合在一起的“构建”目录。它这样做是为了处理新的工作区,并且您可以在不同的工作区中干净地构建不同的项目,而不会相互污染。
If your original template was old, your built product is probably relative to your source directory instead of relative to your built products directory, which is why it's showing up red. By default, your derived data directory will be under ~/Library/Developer/Xcode/DerivedData. To see where your current workspace/project is placing these files, you can File->Workspace Settings...and take a look at the Build Location.
如果您的原始模板较旧,则您的构建产品可能相对于您的源目录而不是相对于您的构建产品目录,这就是它显示为红色的原因。默认情况下,您的派生数据目录将位于 ~/Library/Developer/Xcode/DerivedData 下。要查看当前工作区/项目放置这些文件的位置,您可以File->Workspace Settings...并查看Build Location。
回答by Alexander Fradiani
I was having this problem. not only the product .app was red, also simulator wasn't loaded the binary, it was stuck in attaching 'my app'. i solved it by going to file->project settings. in the tab 'build' changed derived data location to 'project-relative', and in advanced changed build location to 'locations specified by targets'. with the default options it wasn't possible to run the app, i'm not sure why.
我遇到了这个问题。不仅产品 .app 是红色的,模拟器也没有加载二进制文件,它被困在附加“我的应用程序”中。我通过转到文件-> 项目设置来解决它。在选项卡“构建”中将派生数据位置更改为“项目相关”,并在高级中将构建位置更改为“目标指定的位置”。使用默认选项无法运行该应用程序,我不知道为什么。
回答by Anshul Sharma
To resolve the issue in XCode 4.x go through following steps :-
要解决 XCode 4.x 中的问题,请执行以下步骤:-
Open your project in XCode.
在 XCode 中打开您的项目。
Select .xcodeproj file in XCode project Navigator.
在 XCode 项目导航器中选择 .xcodeproj 文件。
Select the target under the PROJECT Heading. (i.e. the top most target, this target specify your project level build settings)
在项目标题下选择目标。(即最顶层的目标,此目标指定您的项目级构建设置)
Now navigate to Build Settings.
现在导航到构建设置。
Now search for option "Per-Configuration Build Products Path" and update it's value to $(SYMROOT) .
现在搜索选项“Per-Configuration Build Products Path”并将其值更新为 $(SYMROOT) 。