Skip to content

Instantly share code, notes, and snippets.

@risinek
Last active August 24, 2023 13:18
Show Gist options
  • Save risinek/fd250ff81ce22d2c7744b1567de53675 to your computer and use it in GitHub Desktop.
Save risinek/fd250ff81ce22d2c7744b1567de53675 to your computer and use it in GitHub Desktop.
This is the example of working plist to run Appium server using launchctl on Mac. See comments for more info and steps how to use this.
<?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>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>com.company.appium.server</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>/usr/local/lib/node_modules/appium/build/lib/main.js</string>
</array>
<key>StandardOutPath</key>
<string>/Users/path/to/logs/stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/path/to/logs/stderr.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>ANDROID_HOME</key>
<string>/path/to/android-sdk</string>
<key>JAVA_HOME</key>
<string>/path/to/java-home</string>
<key>PATH</key>
<string>/content/of/path/env/var</string>
</dict>
</dict>
</plist>
@ltpquang
Copy link

thanks for this handy script, but any solution for mirror all system's env variables to launchd?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment