Adding test target to an existing project is not working

寵の児 提交于 2019-12-01 16:32:55

I had this exact problem. It turns out my existing project was creating my Cocoa Touch Testing Bundle with the .app extension when it should've been a .xctest extension.

You can fix this by going to your test target you created. Build Settings > Wrapper Extension and changing it from app to xctest.

You may have to restart Xcode after this change to select your test target.

UPDATE: I found out the reason the Testing Bundle was becoming a .app extension in the first place. I had to go to the main project Wrapper Extension and make sure it was blank instead of .app. Apparently that was forcing all targets to become .app extension as well.

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