Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run ios simulator for ui Automation test on jenkins

I'm trying to run a UI Automation script from jenkins :

instruments -w 'iPhone 6 (8.1 Simulator)' \
-t '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate' \
'myAppName' \
-e UIASCRIPT 'some_path' \
-e UIARESULTSPATH 'some_other_path'

But I'm getting an error and the simulator won't start

Waiting for device to boot...
2015-03-18 10:29:04.064 instruments[13082:64124] [MT] iPhoneSimulator: Could not launch simulator: -10810

I does work when running from the command line under the jenkins user.

Any Help would be much appreciated, thanks.

like image 735
mesh Avatar asked Mar 18 '15 10:03

mesh


1 Answers

It's probably related to the fact, that you're not running your Jenkins master or Jenkins slave in a desktop session, meaning that it does not have access to your GUI (e.g. it can't launch anything that pops-up a window or a dialog).

So you either need to start the Jenkins master manually or allow it to access the GUI if it's run as a service (not sure how to do this on Mac OS). Another way would be to run a Jenkins slave on the same machine, started via JNLP.

The following Stackoverflow issues deal with the same error message/code and suggest similar solutions:

  • Timed out waiting 120 seconds for simulator to boot
  • Launching XCode Simulator with jenkins user
like image 167
FredG Avatar answered Sep 27 '22 23:09

FredG