Question

i configured out jenkins in way that it was launched under my account but when i build a project for my unit tests with KIF framework, Jenkins launches iPad simulator with black screen and nothing happens (jenkins also doesn't provide any useful information).

Can anyone advice to solution of this issue?

Please note that everything works just fine from command line.

Finally, i've found the solution need to use iPad Retina or iPad Retina (64-bit):

-destination OS=7.0,name=iPad Retina

So, the last supposed suggestion doesn't work either - need another solution.

Was it helpful?

Solution 3

The issue was in Jenkins and it was solved in the following way:

  1. Stop the jenkins daemon via command:

    sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
    
  2. Start Jenkins as process via command:

    sudo nohup java -jar /Applications/Jenkins/jenkins.war --httpPort=8080 --ajp13Port=8010
    

And it works perfectly!

But there is a pitfall, after launching Jenkins under your user, all jobs disappear and you need to create it once again.

OTHER TIPS

Just ran into this myself. Following up on user2738882's self-answer, I have a fix for the pitfalls his solution has:

He's correct that it was occurring due to Jenkins being run as a launch daemon process. Daemon's are launched at start without login, but they aren't intended to have access to the UI. This is what causes the issue.

Unfortunately Jenkins defaults to installing as a launch daemon if you install via the Archive (.war).

The solution I went with is to move it over to a launch agent. To do so follow these steps:

  1. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
  2. sudo cp /Library/LaunchDaemons/org.jenkins-ci.plist /Users/<Path to Jenkins User>/Library/LaunchAgents/org.jenkins-ci.plist
  3. Right click - > Get Info on the org.jenkins-ci.plist file
  4. Change the read write permissions to all users (bottom)
  5. Modify the plist file to change GroupName key value from "daemon" to "agent"
  6. Right click -> Get Info again
  7. Reset the file access to as it was before
  8. sudo launchctl load /Users/<Path to Jenkins User>/Library/LaunchAgents/org.jenkins-ci.plist

The drawback of this approach is launch agents don't start until the user they're associated with logs in. In order to accommodate this I've configured my Jenkins user to login when the server starts up. To do this:

  1. Open System Preferences
  2. Open Groups & Users
  3. Login Options
  4. Set your Jenkins user as the Automatic Login:

This is obviously a security concern, but these machines should only ever be accessible on your local network and in a secure location anyway. Regardless I set the machine to show a screensaver as quickly as possible with a login.

The work-around that I see is that you can create AppleScript, which will run a simulator using terminal. Example:

do shell script "script"

where, script is your terminal command.

After script is created, add build step 'Execute shell script' to jenkins and write script which will run your AppleScript. Example:

open /Applications/MyScript.app
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top