2

I'm trying to start my app from the command line using ios-sim but this is what I get:

Started by user User
Building in workspace /Users/Shared/Jenkins/Home/jobs/UI Testing/workspace
[workspace] $ /bin/sh -xe /var/folders/h4/ws64t3bx2nnds4pg3345xrr000009c/T/hudson6341279754557259451.sh
+ /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app

    [DEBUG] Could not start simulator session: Error Domain=DTiPhoneSimulatorErrorDomain Code=5
 "Operation failed with underlying error 4294956486." UserInfo=0x1001b1760 
{NSLocalizedDescription=Operation failed with underlying error 4294956486., 
NSUnderlyingError=0x1001a3390 "The operation couldn’t be completed. (OSStatus error -10810.)"}

It looks like a permission problem as I can run the same command from terminal and it works fine. I've also tried to give full 777 permission to ios-sim and the MonkeyTalk directory,but still nothing.

Any idea?

Claus
  • 5,662
  • 10
  • 77
  • 118
  • there is something here https://github.com/phonegap/ios-sim/issues/5 but quite old – Claus Nov 22 '12 at 19:41
  • Having the same problem here, working in terminal but not through Jenkins. Have you found a solution? – zavié Jan 10 '13 at 18:37

4 Answers4

5

It might be related to the Jenkins process not having a "display". Try running Jenkins as a user logged in to the desktop, then run the ios-sim again.

Unload Jenkins from launchd:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

Then run Jenkins from a terminal:

sudo su jenkins -c "JENKINS_HOME=/Users/Shared/Jenkins/Home /Library/Application\ Support/Jenkins/jenkins-runner.sh"

If this works, you can make Jenkins always run as a logged in user by moving the launchd job config file from /Library/LaunchDaemons/org.jenkins-ci.plist to ~/Library/LaunchAgents/org.jenkins-ci.plist

cimmanon
  • 67,211
  • 17
  • 165
  • 171
KennyC
  • 921
  • 7
  • 16
1

I know this post was from a while ago, and not sure if anyone is checking it, but I also ran into this issue recently and it turned out that there was a duplicate app already in the iphone simulator creating an issue and not letting the new app run.

I reset the simulator and it then worked. I then added the applescript to reset the simulator each time before running ios-sim. this script can be found here...

How can I reset the iOS Simulator from the command line?

Scroll down the answer that has 13 up votes next to it, not the one that was checked marked.

Hope this helps someone in the future..

Community
  • 1
  • 1
bolnad
  • 4,533
  • 3
  • 29
  • 41
0

It looks like the only workaround it's to run the command as super user:

sudo /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app
Claus
  • 5,662
  • 10
  • 77
  • 118
0

I was also facing the same problem and found that jenkins user is not correctly set up to run test case on simulator. Follow instruction given on below website:

http://pivotallabs.com/ios-ci-jenkins/

see the section "SETTING UP THE JENKINS USER".

hope it will work for you as well.