5

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?

Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66
Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103

3 Answers3

7

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.

Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66
  • This option doesn't show up in the UI in Xcode 5 anymore. It's now a User-defined setting called "TEST_AFTER_BUILD". – Jon Tirsen Dec 11 '13 at 16:29
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/

Harry
  • 87,580
  • 25
  • 202
  • 214
Kohei Tabata
  • 585
  • 4
  • 11
  • 1
    Please enclose all inline code blocks within ` for them to be formatted as code. For multi-line codes either indent them by 4 spaces (or) use the `{}` button in the button bar. Other thing, rather than posting a link please post its essential contents also into the answer. This will make sure that your answer wouldn't lose its worth even if the link becomes inactive. – Harry Sep 23 '13 at 07:45
1

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

Bin Chen
  • 140
  • 1
  • 5