Irios
Irios

Reputation: 523

Using Instruments to launch automation tests via SSH

I'm currently trying to run iOS mobile functional tests from a CI server. Just so you know I'm using the Calabash framework but my problem is related to Instruments : Instruments doesn't launch the requested device.

When I use Instruments directly from the terminal on the server, everything goes fine (Instruments -w "iPhone 5s (8.1 Simulator)" for example). I get the following message :

Waiting for device to boot... Instruments Usage Error : No template (-t) specified instruments, version 6.1 (56160) usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w > device] [[-p pid] | [application [-e variable value] [argument ...]]]*

However when I launch the same command from an SSH connection, it ignores the requested device and launches the device previously used. And this time it stays stuck at Waiting for device to boot...

Does anyone have an idea that could explain this behaviour ? Why would it work from a local session and not from a remote ssh connection, and how to fix it ?

I have Instruments in version 6.1, on OS X Yosemite.

Thank you.

Upvotes: 2

Views: 614

Answers (2)

vicwomg
vicwomg

Reputation: 609

Ran into the same thing. If you use Jenkins as your CI server, connecting your slave using JNLP Web Start instead of SSH will allow instruments to work as expected. Not an ideal solution for all configurations, but it does the trick.

Upvotes: 0

ekcrisp
ekcrisp

Reputation: 1911

Good question, I know that if the process being run is considered a background or system task it won't be able to launch instruments and run the test since it requires user level runtime status. I discovered this when trying to launch instruments from a cron job. When you ssh your shell thread may be considered system level. My only suggestion would be to put your commands in a shell script, and somehow call the script on a user-level thread. Unfortunately I am not a unix expert and cannot give you the specifics of how to do that, hope this helps.

Upvotes: 1

Related Questions