#Start appium server
appium_log=appium.log
appium_cmd="node <REPLACE_WITH_APPIUM_PATH>/appium/lib/server/main.js"
echo "[INFO] Appium command: $appium_cmd"
$appium_cmd &> $appium_log&
appium_pid=$!
#check if appium was successfully started
sleep 1
appium_pid_start=`ps -p $appium_pid | grep node | awk '{ print $1 }'`
if [ -z $appium_pid_start ] ; then
echo "[ERROR] Appium failed to start! Port $appiumport may be already in use. "
exit 1
fi
echo "[INFO] Appium started with pid: $appium_pid . Logging to: ${appium_log}"
# be sure to kill appium on script stop
trap "kill $appium_pid" SIGINT SIGTERM EXIT
However this always returns an error: " Appium failed to start! Port may be already in use. " But the appium did not start.. and when doind ps on the command line is possible to see that appium is not running.
Can you please help me out?