Hi. I’m trying to setup Appium server to stat automatically after system startup. Also I’d like it to restart after a crash. Appium was installed as a npm package and it launches and works fine when I type “appium” in terminal.
What I did is created file io.appium.server.plist in /Library/LaunchAgents/ with the following content:
For some reason this did not start appium server, I cannot connect to it. The “launchctl list” command reported that my task exited with 78 status code, but in Appium’s documentation I cannot find what’s meant by this exit code. Can anybody help please?
I haven’t done it the same way as you, but creating an automator application for my start appium shell script then adding that automator app to startup items works fine.
If you have a script that checks whether appium is running on the specified port and starts if if not true, it will relaunch appium after crash.
It was the only way I could get multiple appium instances running (logging to the same file) without any terminal window open and without throwing error messages.
I feel like building my own script to check appium status and restart it is bad solution since this functionality is already build into operating system. All you need is to use it. So I’m trying to investigate why Appium exits with status code (exit code) 78 and how to fix this.
the Appium will not started if you put appium –session-override, because launchctl it is not bash, it could not locate the appium.
you could try
/usr/local/bin/node
/usr/local/lib/node_modules/appium/bin/appium.js
to replace appium in your configuration. it is working in my side
@jackysf , yes, everything is set up and works fine when I start appium from terminal. But when Appium is started by launchd, it rises that errors. I attempted to set ANDROID_HOME variable in /etc/launchd.conf , but this didn’t help…
When I started appium-doctor.js as launchd agent, it’s output was:
Running iOS Checks
Б°■ Xcode is installed at /Applications/Xcode.app/Contents/Developer
Б°■ Xcode Command Line Tools are installed.
Б°■ DevToolsSecurity is enabled.
Б°■ The Authorization DB is set up properly.
Б°■ Node binary found at /usr/local/bin/node
Б°■ iOS Checks were successful.
Running Android Checks
Б°√ ANDROID_HOME is not set
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.
When I run doctor from terminal:
$ node /usr/local/lib/node_modules/appium/bin/appium-doctor.js
Running iOS Checks
Б°■ Xcode is installed at /Applications/Xcode.app/Contents/Developer
Б°■ Xcode Command Line Tools are installed.
Б°■ DevToolsSecurity is enabled.
Б°■ The Authorization DB is set up properly.
Б°■ Node binary found at /usr/local/bin/node
Б°■ iOS Checks were successful.
Running Android Checks
Б°■ ANDROID_HOME is set to "/Users/username/Desktop/android-sdk-macosx"
Б°■ JAVA_HOME is set to "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home."
Б°■ ADB exists at /Users/username/Desktop/android-sdk-macosx/platform-tools/adb
Б°■ Android exists at /Users/username/Desktop/android-sdk-macosx/tools/android
Б°■ Emulator exists at /Users/username/Desktop/android-sdk-macosx/tools/emulator
Б°■ Android Checks were successful.
Б°■ All Checks were successful
depends on where you put the plist. if you put into ~/Library/LaunchAgents, then launchd must process after you login.
if put into /Library/LaunchDaemons, the launch with system start
Hi Simon!
Could you share the details I am new to Mac-Os. I am trying to run appium in background I have written script which will run in background even if we close the terminal.
I tried it with automator but i cannot see node process running in activity control
how can I achieve with startup items.?
It is desperately needed to conclude in my standup call.
Hi al007!
Could you share the complete script (.plist) I am desperately needed this to run in background along with session override as we are automating appium and selenium for android tests.
I have written the script which will run in background even if terminal close but i need this at startup
What do people use for log rotation? I’ve been trying newsyslog, but I find that I lose logging as soon as it fills up the specified number of backups.