-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wont run under Hudson/Jenkins #5
Comments
Can you elaborate on what you mean by running the build manually? From the terminal? I have no experience with Jenkins. I'll try to find some time this week to set it up and debug it. |
I use ios-simulator with jenkins and it works fine. ThanksJonas |
@jonasschnelli That’s great to hear, thanks! I’ll wait with installing Jenkins to see if further information will allow you to diagnose the problem first. |
In our project ios-sim is integrated ad git-submodule and get also a xcodebuild in the build script. |
My xcode target has as it's last step a build script that runs ios-sim. If I do xcodebuild myself it works. When it's called from jenkins it doesn't. I'm not sure how to go about figuring this out. I believe that ios-sim makes the system call to launch the iPhone app and then doesn't hear anything until it times out. There doesn't seem to be any other diagnostic information than that. I would be happy to investigate myself if I knew how to get more information about trying to launch the iPhone app. |
jonasschnelli: I'll try compiling ios-sim on our build machine and see if that helps. Here is the line from my script file that runs ios-sim: /usr/local/bin/ios-sim launch "$RUN_CMD" --env "$ENV_PATH" The xcode target that builds the app has a run script build phase that runs the script. |
yes. it's not trivial. What's on your build-servers screen during the jenkins build process? What you also can try it to "cd" to the jenkins job-dir and try to launch the ios-sim on the buildserver. |
Added --std-err but the file is never created. It does report the path to the stderr file so I know that's working correctly. I still get the same error. I was setting a bunch of malloc/NSZombieEnabled stuff but I commented all that out and still no joy. The build machine has iOS Simulator showing. I just deleted the app and ran my jenkins build and the app is never installed. |
sounds complicated. |
@jonasschnelli I was thinking that it might be handy to have a basic wiki entry with the steps needed to run it with Jenkins. Could I persuade you to write that? :) |
@alloy ... yes. possible. as soon as some time is here... :) |
@jonasschnelli Good enough for me! :) |
It seems like the problem is that jenkins runs build as root user. |
If anyone is still having issues with this, you could check out the simlauncher gem I made a while back. Code is on github or just |
I actually have been battling essentially the same issue, launching the simulator from Jenkins via Instruments. Same errors, same frustrations. The solution that works for me, strangely enough, is to set up passwordless SSH using public key and have the machine ssh into itself to start and use the simulator. When Jenkins was invoking the simulator through instruments it wasn't working, but sshing from another machine (or user on the same machine, etc.) works. One catch is that the jenkins user also has to be logged into the UI for the simulator to work reliably. Hope this helps someone. |
@quellish.. Hi I am trying to do the same as you did but I am getting "Permission denied (publickey,keyboard-interactive). |
At some point I am going to write a detailed article (and code) for setting up Jenkins to run UIAutomation. @shri-idev , your issue is SSH public key authentication, which rarely works as advertised the first time. Public key authentication removes the need for a password, which is what you need for this to work. These two guides should help you solve your problems: |
Seems like the problem is to do with how jenkins is launched. When installing Jenkins on our build server, it created the launchd plist in |
Moving the launchd plist from |
@ehuynh 's answer seems to be the solution. Closing. |
When ios-sim is launched on Jenkins, I'm facing the described problem: "Simulator session timed out.". I've moved the plist but no luck even after restart of the Jenkins. Should I also restart whole machine? |
I am also having the same issue, moving the plist file did not work for me. This issue definitely should be re-opened! |
It seems that Jenkins needs to have access to the window server's session so that ios-sim can properly communicate with the iOS Simulator. When I launch Jenkins via |
Moving the org.jenkins-ci.plist to ~/Library/LaunchAgents did work on my Jenkins server on MacOSX either. I moved it out of the main drive and into my user folder and still no luck "/Users/me/Library/LaunchAgents" and same error. |
I'm having this same issue "Simulator session timed out". Moving the plist files didn't work for me either which might be due to the fact that I'm running my build process on a different node than the master jenkins machine. I CAN run the xcodebuild command that jenkins is running manually from terminal and it works perfectly. But when it is ran from jenkins it fails with "Simulator session timed out". Can ANYONE help with this? I've been searching and searching but have found nothing that helps. |
Yes. Had the same issue when running with Jenkins. The problem is that ios-sim launches the actual simulator (window and all). So, you need to have an actual desktop session happening for your jenkins user, so the window has somewhere to launch. |
This moved my CI efforts forward significantly. I'm having this "simulator session timed out" issue too. In my case, the Hudson server is on windows and the Mac is running as a slave. So, there's no plist file to move. I've noticed that the simulator starts, but i still get the error. Any more thoughts? I think i've tried everything listed here. When i execute my ant script from the command-line (logged in as the build user), it executes correctly and generates the Junit test files. When i run the same script from the Hudson slave (started via ssh using the same credentials), it fails with this error. Thanks -- Dan'l |
I always get the following when running under Jenkins:
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 UserInfo=0x100270b90 "Simulator session timed out."
If I run the build manually from the workspace dir of jenkins it works. Any ideas?
The text was updated successfully, but these errors were encountered: