Jenkins+Yosemite+Appium Failed to authorize rights (0x1)

After managing to sucessfully upgrade to Appium 1.3.1 and Xcode 6 (IOS 8.1). But when I upgraded my Mac OSx to Yosemite I am getting the following issue.
2014-11-13 10:28:19:027 - info: [debug] Getting list of devices instruments supports
2014-11-13 10:28:19:036 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
2014-11-13 10:28:31:079 - error: Failed getting devices. Err: Error: Command failed: . Stdout: . Stderr: .
2014-11-13 10:28:31:079 - info: [debug] Cleaning up appium session
2014-11-13 10:28:31:080 - error: Failed to start an Appium session, err was: Error: Failed getting devices. Err: Error: Command failed: . Stdout: . Stderr: .
2014-11-13 10:28:31:081 - info: [debug] Error: Failed getting devices. Err: Error: Command failed: . Stdout: . Stderr: .
at /usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:103:19
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

But then if I retry
2014-11-13 10:29:51:903 - info: [debug] [INST STDERR] Failed to authorize rights (0x1) with status: -60007.
2014-11-13 10:29:52:020 - info: [debug] [INST STDERR] 2014-11-13 10:29:52.019 instruments[53040:375449] -[XRSimulatorDevice prepareConnection:]: Unable to authorize simulated daemon (53041): 8
2014-11-13 10:30:00:068 - info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug

I have tried
sudo security authorizationdb write system.privilege.taskport allow
security -v unlock-keychain

and run the authorize_ios

This happens only when the tests are running via jenkins job. If I run it from the command line I only get the first error and that too only once and upon retry the test runs fine.
Any help is appreciated.
thanks
Ali

I have looked at this issue (#3796)
which I think it is working as intended, so apparently the real issue is
2014-11-13 10:29:51:903 - info: [debug] [INST STDERR] Failed to authorize rights (0x1) with status: -60007.
2014-11-13 10:29:52:020 - info: [debug] [INST STDERR] 2014-11-13 10:29:52.019 instruments[53040:375449] -[XRSimulatorDevice prepareConnection:]: Unable to authorize simulated daemon (53041): 8

I know authorize_ios takes care of this but apparently it is not helping in this case.

Thanks
Ali

I have the same problem after upgrading Mac to Yosemite. Instruments start and tests run from command line, but not via jenkins job.

I have the same issue.

My log:

[36minfo[39m: [debug] [33m[INST STDERR] Failed to authorize rights (0x1) with status: -60007.[39m
[36minfo[39m: [debug] [33m[INST STDERR] 2014-11-25 18:23:55.826 instruments[390:5382] -[XRSimulatorDevice prepareConnection:]: Unable to authorize simulated daemon (412): 8[39m
[36minfo[39m: [debug] [33m[INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.example.app was denied.[39m
[36minfo[39m: [debug] [90m[INSTSERVER] Instruments exited with code 253[39m
[36minfo[39m: [debug] Killall instruments

Not strictly the same issue- but we’re seeing the same message with Calabash and Jenkins. Hooking into this thread as it’s likely to be the same problem.

I ran into the same issue today after having Jenkins run as a LaunchAgent. My solution was to start Jenkins through the Terminal instead.

java -jar jenkins.war

This isn’t the best answer - Jenkins doesn’t start automatically on login anymore - but at least the tests are running.

I had the same issue when run Appium as a daemonized process, my command to start appium is :
daemonize /usr/local/bin/appium