Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team City CI with Xcode workspace - Scheme "My Scheme" is not configured for running

I have a workspace with few projects that must be built as static libraries and I have schemes with tests for them. I want to configure TeamCity to build and test each of those libraries, but it does not work with following error:

...
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace code/MyApplication/My Framework.xcworkspace -scheme One Of Tests TEST_AFTER_BUILD=YES clean build -configuration Debug -sdk iphonesimulator6.1
in directory: /Users/Me/TeamCity/buildAgent/work/d0f083d874fc6891
Build settings from command line:
    SDKROOT = iphonesimulator6.1
    TEST_AFTER_BUILD = YES
xcodebuild: error: Failed to build workspace My Framework with scheme One Of Tests.
    Reason: Scheme "One Of Tests" is not configured for running.
Process exited with code 70
...

But at the same moment, when I clone my repository, cd into it and run command from above in terminal:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace code/MyApplication/My Framework.xcworkspace -scheme One Of Tests TEST_AFTER_BUILD=YES clean build -configuration Debug -sdk iphonesimulator6.1

It succeeds: // UPDATE: It worked only for build schemes, not for tests

** BUILD SUCCEEDED **  

So it's definitely wrong settings in TeamCity. What can I try to make it works?

P.S. Schemes for building libraries work fine. Only with tests throw errors.

like image 944
Ossir Avatar asked Jun 14 '13 14:06

Ossir


People also ask

Where is my Xcode project scheme?

To view and modify your project's current schemes, select Manage Schemes. For example, disable automatic creation of schemes for new targets, and change scheme attributes such as which project contains the scheme. By default, Xcode shares schemes with other team members.

What is Xcode scheme?

An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.


1 Answers

I found solution. The problem was about poor support of SenTestKit with xcodebuild command. To make it works I had to go Edit Scheme menu and set Run step so the test scheme became runnable.

Thanks for solution this article. There're few things was actually different, it is a Test After Build setting and macros. In my case it runs test only with YES option and I did not have to write any macros. Mb they fix the issue that was described in the article.

like image 186
Ossir Avatar answered Oct 26 '22 15:10

Ossir