Build target randomly added to Xcode scheme

北城余情 提交于 2020-01-01 05:20:11

问题


I am developing an iPhone app using Xcode 5 and CocoaPods. I have a scheme and target called Oahu that I run my tests against. Accordingly, I am not surprised to see my two test targets present to be built in the scheme's build phase. However, there is a fourth build target that cannot be removed:

When I run tests, all four targets are built, and the test targets are run against the last, incorrect one, Ku.

And after closing Xcode, deleting the contents of the DerivedData directory, and deleting all the *userdata files in my project directory (find ./ | grep userdata | xargs rm -rf), I still have an extraneous build target:

Notice that it now included my Production target and I also had unchecked Find Implicit Dependencies.

I've looked through all my build settings, Oahu.xcscheme, and project.pbxproj, but I can't find anything that would leave to this behavior. Unchecking the scheme's Build Option Find Implicit Dependencies has no effect.

This Oahu scheme is the only one that has this problem – the Ku and Production schemes only have their corresponding targets – though if I duplicate the Oahu scheme, it also has this problem.

Can this be fixed?


回答1:


I found all my build and test problems were related to having the same binary name. Renaming the binaries produced by each target to be unique fixed the problem.




回答2:


I just had the same issue. In my case the additional target appeared in the build settings of the scheme's target. You can search for the undesired target name there, I found mine under BUNLDE_LOADER and TEST_HOST. It got fixed after I deleted the settings.




回答3:


In my case, it was because the target was listed under Target Dependencies under the Build Phases of my test target.



来源:https://stackoverflow.com/questions/24169392/build-target-randomly-added-to-xcode-scheme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!