"Bad app" error message when starting Appium over SSH with tmux


I’m starting Appium over SSH in a tmux session, where all environment variables are ignored and have to be set manually. My script looks like that:

#! /bin/sh
/usr/local/Cellar/tmux/2.1/bin/tmux new -d -s my-session 'export PATH=/usr/local/Cellar/ideviceinstaller/1.1.0_2/bin; /usr/local/bin/node /usr/local/lib/node_modules/appium/bin/appium.js --command-timeout "7200" --debug-log-spacing --platform-version "9.1" --platform-name "iOS" --app "/Users/<USERNAME>/mobile/apps/test.ipa" --udid "<UDID>" --full-reset --show-ios-log --device-name "iPhone 5"' \;

Which results in an error like:

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Bad app: /Users/qa/mobile/apps/test.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Command failed: /bin/sh -c find /var/folders/g4/b30th7_x3zb_0zsy55j024cr0000gn/T/11619-714-1jgyooi -type d -name '*.app' | xargs rm -rf /var/folders/g4/b30th7_x3zb_0zsy55j024cr0000gn/T/11619-714-1jgyooi/Payload*

Any idea ?

It seems like it was a simple mistake:

I had to set the bundleID in the --app argument and the path in --ipa but I set the path to the .ipa in --app. Sometimes the solution is so simple :wink: