3

I have similar issue as this one

I am trying to implement Test Reports of Xcode on Jenkins using xctool. Executing this command in the local terminal it works as expected:

/usr/local/bin/xctool -workspace Sample.xcworkspace -scheme Samplescheme -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO WANT_IOS_SIM=YES -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' clean test -reporter junit:test-reports/reports.xml

However using exactly the same one on Jenkins as an Execute Shell command, fails with this error:

/usr/local/bin/xctool -workspace Sample.xcworkspace -scheme Samplescheme -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO WANT_IOS_SIM=YES -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' clean test -reporter junit:test-reports/reports.xml
Build step 'Execute shell' marked build as failure
Recording test results
Finished: FAILURE

Note: Execute shell contains only that single line (it is for sure that the error is caused from that line). Also fyi, project is using cocoapods

Any idea what can cause this behaviour?

Community
  • 1
  • 1
hrskrs
  • 4,447
  • 5
  • 38
  • 52
  • Your command is well formatted (assuming things like project, scheme names and such are accurate), so it points to an environment related issue. Is your Jenkins instance running under a logged-in OS X GUI user or is it running as a background service without a Finder session? I would expect to see those kinds of errors crop up when there isn't an authenticated environment in which shell scripts can execute. iOS Simulator has historically griped about being asked to run 'headless', so even if you managed to get the build to run under headless configs, I don't believe unit testing would work. – Bryan Musial Nov 08 '15 at 01:31
  • Postscript: Use of Cocoapods on a CI server is very much supported, however you do need to install and initialize the Cocoapods repository on the build agent, and then add specific build tasks that perform `pod install` prior to attempting to build the requested build target. – Bryan Musial Nov 08 '15 at 01:33
  • @BryanMusial I moved to OSX server for iOS projects and its going well. Anyway thnx for helping – hrskrs Nov 09 '15 at 09:19

0 Answers0