I am trying to do a simple job with an Xcode project with TeamCity. Without performing any tests, I succeeded.
I have a basic Single View application in Swift with a single label on the screen. Both TeamCity (9.0.2) and Xcode (6.1.1) work on the same computer (Mac mini) with OS X (10.10.2) Server (4.0.3) installed on it. I created a Git repository with a server and added as a remote project of my Xcode. After that, I successfully created a TeamCity working project and built it.
However, when I try to check the Run tests box, the WILL assembly will fail regardless of what I do.
Configuration (image with frame) https://dl.dropboxusercontent.com/u/55101816/Screen%20Shot%202015-03-01%20at%2002.45.48.png
Error message (and messages before that)
[02:31:48][FirstTeamCityProjectTests (BUILD)] Touch [02:31:48][Touch] Touch build/Debug-iphoneos/FirstTeamCityProjectTests.xctest [02:31:48][Touch] cd /Library/TeamCity/buildAgent/work/55b27ad210b8fe77 [02:31:48][Touch] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/> ontents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin" [02:31:48][Touch] /usr/bin/touch -c /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build/Debug-iphoneos/FirstTeamCityProjectTests.xctest [02:31:48][FirstTeamCityProjectTests (BUILD)] CodeSign [02:31:48][CodeSign] CodeSign build/Debug-iphoneos/FirstTeamCityProjectTests.xctest [02:31:48][CodeSign] cd /Library/TeamCity/buildAgent/work/55b27ad210b8fe77 [02:31:48][CodeSign] export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate [02:31:48][CodeSign] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/ Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin" [02:31:48][CodeSign] Signing Identity: "iPhone Developer: *" [02:31:48][CodeSign] /usr/bin/codesign --force --sign * /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build/Debug-iphoneos/FirstTeamCityProjectTests.xctest [02:31:48][Step 1/1] ** BUILD SUCCEEDED ** [02:31:48][Step 1/1] xcodebuild: error: Failed to build workspace FirstTeamCityProject with scheme FirstTeamCityProject. [02:31:48][Step 1/1] Reason: Xcode cannot run using the selected device. [02:31:48][Step 1/1] Process exited with code 70 [02:31:48][Step 1/1] Step Xcode Project failed
The main problem I found with this error code and the CI they tried using ssh and there was no GUI session. I currently have a valid GUI session with the same user that he is using, so this should not be a problem.
The xcodebuild command is as follows.
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace FirstTeamCityProject.xcodeproj/project.xcworkspace -scheme FirstTeamCityProject SYMROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build OBJROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build clean build test
What is missing here (I suppose) is one or more destinations. I ran the following command and everything went fine. (He opened the Simulator and then came out with success.)
xcodebuild test -project FirstTeamCityProject.xcodeproj -scheme FirstTeamCityProject -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1'
I seem to be the only one with this problem, I have not found any other relevant hits. Looking at this tutorial: http://pivotallabs.com/ios-continuous-deployment-teamcity-hockeyapp/ , my problem should not be present at all.
EDIT: The destination is really missing, but I don't understand why. Moreover, if I try to add it manually, the assembly will fail. (I suspect that the order of the parameters matters, but how can I add this destination elsewhere in TeamCity.)
[01:48:12][Step 1/1] Building project: /Library/TeamCity/buildAgent/work/55b27ad210b8fe77/FirstTeamCityProject.xcodeproj [01:48:12][Step 1/1] Using Xcode 6.1.1 [01:48:12][Step 1/1] Starting: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace FirstTeamCityProject.xcodeproj/project.xcworkspace -scheme FirstTeamCityProject SYMROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build OBJROOT=/Library/TeamCity/buildAgent/work/55b27ad210b8fe77/build clean build test -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' [01:48:12][Step 1/1] in directory: /Library/TeamCity/buildAgent/work/55b27ad210b8fe77 [01:48:12][Step 1/1] xcodebuild: error: option 'Destination' requires at least one parameter of the form 'key=value'
I appreciate any idea you have! Thank you in advance!