Same problem here when building on Jenkins CI.
The jenkins node is launched through a launchd daemon.
/Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
				<key>KeepAlive</key>
				<true/>
				<key>Label</key>
				<string>org.jenkins-ci.node.jnlp</string>
				<key>ProgramArguments</key>
				<array>
								<string>/bin/bash</string>
								<string>/Users/user/jenkins/node.jnlp.sh</string>
				</array>
				<key>RunAtLoad</key>
				<true/>
				<key>SessionCreate</key>
				<true/>
				<key>StandardErrorPath</key>
				<string>/Users/user/jenkins/org.jenkins-ci.node.jnlp.stdout.log</string>
				<key>StandardOutPath</key>
				<string>/Users/user/jenkins/org.jenkins-ci.node.jnlp.stderr.log</string>
				<key>UserName</key>
				<string>user</string>
				<key>WorkingDirectory</key>
				<string>/Users/user/jenkins</string>
</dict>
</plist>
Loading this as root gives us the failure as previous posters (Unable to open liblaunch_sim.dylib):
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist
But instead loading without sudo when running as the user specified by UserName everything passes:
launchctl load /Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist
Though my understanding is that the UserName key will run the script as the same user as my second example.
I just don't have enough understanding of launchd to figure out how to solve the issue...
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: