Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RunUnitTests error after Xcode 5 update

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?

like image 752
Sarp Kaya Avatar asked Sep 23 '13 06:09

Sarp Kaya


3 Answers

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.

like image 97
Swift Dev Journal Avatar answered Sep 28 '22 02:09

Swift Dev Journal


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/

like image 44
Kohei Tabata Avatar answered Sep 28 '22 02:09

Kohei Tabata


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

like image 21
Bin Chen Avatar answered Sep 28 '22 03:09

Bin Chen