RunUnitTests error after Xcode 5 update

别等时光非礼了梦想. 提交于 2019-12-10 15:18:51

问题


All I did was to update the project to Xcode 5. Now when I try to run tests I am getting this error

if [ "${TEST_AFTER_BUILD}" = "YES" ]; then
    Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild."
    Note ${LINENO} "You can remove the Run Script build phase that invokes RunUnitTests from your unit test bundle target."
    # Exit with EX_UNAVAILABLE to indicate that this subsystem is unavailable.
    exit 69
fi

Where Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild." is highlighted red. I googled this problem but could not find any answer. What could be the problem and how can I solve it?


回答1:


You most likely have the build setting Test After Build set to YES. Xcode 5 does not support the Test After Build build setting. Set Test After Build to NO and the error should go away.




回答2:


Use this command.

xcodebuild test -scheme <YOUR SCHEME NAME HERE> -destination OS=6.1,name=iPhone

I also googled and find this site. http://petosoft.wordpress.com/2013/06/25/running-unit-tests-using-jenkins-and-xcodebuild-on-xcode-5-0/




回答3:


The TEST_AFTER_BUILD option becomes user defined settings in Xcode 5. Just delete it will be ok.



来源:https://stackoverflow.com/questions/18953044/rununittests-error-after-xcode-5-update

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