Giter VIP home page Giter VIP logo

Comments (27)

alloy avatar alloy commented on July 23, 2024

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.

from ios-sim.

jonasschnelli avatar jonasschnelli commented on July 23, 2024

I use ios-simulator with jenkins and it works fine.
cgriffin: can you give us some more informations? Like the whole command you kicking off?

Thanks

Jonas

from ios-sim.

alloy avatar alloy commented on July 23, 2024

@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.

from ios-sim.

jonasschnelli avatar jonasschnelli commented on July 23, 2024

In our project ios-sim is integrated ad git-submodule and get also a xcodebuild in the build script.
So we ensure that the ios-sim was propperly built on the build-machine itself (no precompiled binary).
This is because the developer dir sometime has different locations.

from ios-sim.

cgriffin avatar cgriffin commented on July 23, 2024

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.

from ios-sim.

cgriffin avatar cgriffin commented on July 23, 2024

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.

from ios-sim.

jonasschnelli avatar jonasschnelli commented on July 23, 2024

yes. it's not trivial.
I've extended my unit test app that it terminate at the end... maybe otherwhise it would break jenkins build-run.

What's on your build-servers screen during the jenkins build process?
Can you see the simulator?
Is there a app loaded?

What you also can try it to "cd" to the jenkins job-dir and try to launch the ios-sim on the buildserver.
Always set the --std-err parameter to a file which can be used to debug later.

from ios-sim.

cgriffin avatar cgriffin commented on July 23, 2024

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.

from ios-sim.

jonasschnelli avatar jonasschnelli commented on July 23, 2024

sounds complicated.
What about running ios-sim from the shell manually?
Same issue?

from ios-sim.

alloy avatar alloy commented on July 23, 2024

@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? :)

from ios-sim.

jonasschnelli avatar jonasschnelli commented on July 23, 2024

@alloy ... yes. possible. as soon as some time is here... :)

from ios-sim.

alloy avatar alloy commented on July 23, 2024

@jonasschnelli Good enough for me! :)

from ios-sim.

igoris avatar igoris commented on July 23, 2024

It seems like the problem is that jenkins runs build as root user.
This is what I found:
if you enter
sudo su
and then run script that will call ios-sim, all is ok
but if you enter
sudo su -
then ios-sim will fail with
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 UserInfo=0x100270b90 "Simulator session timed out."

from ios-sim.

moredip avatar moredip commented on July 23, 2024

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 gem install sim_launcher. It uses an older version of this project (back when it was called iphonesim), but I'd be happy to start using ios-sim if there're benefits.

from ios-sim.

quellish avatar quellish commented on July 23, 2024

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.

from ios-sim.

shri-idev avatar shri-idev commented on July 23, 2024

@quellish.. Hi I am trying to do the same as you did but I am getting "Permission denied (publickey,keyboard-interactive).
" error even after entering correct password. What I am missing here?? Can you please explain a bit about "set up passwordless SSH using public key and have the machine ssh into itself "..

from ios-sim.

quellish avatar quellish commented on July 23, 2024

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:
http://www.noah.org/wiki/SSH_public_keys#Permission_problems_with_SSH
http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html

from ios-sim.

ehuynh avatar ehuynh commented on July 23, 2024

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 /Library/LaunchDaemons. When trying to launch ios-sim, I encountered the same error above, and as others have pointed out, the issue seems to be that jenkins is no run as the logged in user. By moving the launchd plist to /Library/LaunchAgents instead, so that its run as the logged in user, this solved the problem. Got this idea from kif-framework/KIF#72

from ios-sim.

joshuatbrown avatar joshuatbrown commented on July 23, 2024

Moving the launchd plist from /Library/LaunchDaemons to /Library/LaunchAgents, as @ehuynh suggested, worked for me, too.

from ios-sim.

shazron avatar shazron commented on July 23, 2024

@ehuynh 's answer seems to be the solution. Closing.

from ios-sim.

azubala avatar azubala commented on July 23, 2024

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?

from ios-sim.

sammio2 avatar sammio2 commented on July 23, 2024

I am also having the same issue, moving the plist file did not work for me. This issue definitely should be re-opened!

from ios-sim.

mbinna avatar mbinna commented on July 23, 2024

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 ~/Library/LaunchAgents everything works as expected. I wrote an article that describes the whole setup: Continuous Integration of iOS Projects using Jenkins, CocoaPods, and Kiwi

from ios-sim.

jjacquet avatar jjacquet commented on July 23, 2024

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.

from ios-sim.

atljeremy avatar atljeremy commented on July 23, 2024

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.

from ios-sim.

LowAmmo avatar LowAmmo commented on July 23, 2024

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.
All you need to do is either trigger an auto-login of your Jenkins user, or VNC to the box and log in as the jenkins user. That will start a desktop session for the jenkins user, and then the simulator will be able to correctly launch and run.

from ios-sim.

dlindbergjhs avatar dlindbergjhs commented on July 23, 2024

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

from ios-sim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.