Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when attempting to run UI automation script from jenkins

I am using Xcode 6.1. And i need to run a UI automation script from jenkins as a post build action. The command that i use is shown below.

instruments -t $TRACETEMPLATE -w $DEVICE $APP_PATH -e UIASCRIPT $SCRIPT -e UIARESULTSPATH $RESULTS_PATH | grep "<"  > test-reports/test-results.xml

When i run that the following error is thrown by jenkins.

Failed to authorize rights (0x1) with status: -60007. 2014-11-12 16:31:30.685 instruments[488:2607] -[XRSimulatorDevice prepareConnection:]: Unable to authorize simulated daemon (99637): 8 Instruments Trace Error : Target failed to run: Permission to debug com.test.app was denied.

Any help is much appreciated.

like image 494
Lrenger semigo Avatar asked Nov 12 '14 12:11

Lrenger semigo


1 Answers

  1. The user that invokes Instruments must have developer permissions. The user must be in the _developer group.

  2. Security permissions allowing the user to access Instruments must be set. See the man page for DevToolsSecurity

  3. The user must be logged in to a window server to use the simulator. How to do this will depend somewhat on your Jenkins and OS configuration for that user. In older versions of MacOS creating an SSH connection back into the machine and running Instruments through that connection typically worked. YMMV.

Note that any of the above steps escalates the rights for the Jenkins user, which was security implications.

like image 190
quellish Avatar answered Oct 31 '22 08:10

quellish