Trying to start Appium with --default-capabilities

I’m trying to lauch Appium in the Windows Powershell on Windows 10 with the following command:

C:\Users\Quaspiel\Desktop> appium --pre-launch --default-capabilities '{
 "app": "C:/Users/Quaspiel/Desktop/tapsterbot-dev/tapsterbot-dev/calibration/android/calibration-android.apk",
 "platformName": "Android",
 "platformVersion": "8.0.0",
 "deviceName": "GalaxyS7",
 "autoLaunch": "true",
"appPackage": "pylapp.tapster.calibration.android",
"appActivity": "pylapp.tapster.calibration.android.MainActivity"

}’

but I only get this output:

C:\Program Files\nodejs\node_modules\appium\build\lib\main.js: error: argument "-dc/--default-capabilities": Invalid parseDefaultCaps value: {
    app: C:/Users/Quaspiel/Desktop/tapsterbot-dev/tapsterbot-dev/calibration/android/calibration-android.apk,
    platformName: Android,
    platformVersion: 8.0.0,
    deviceName: GalaxyS7,
    autoLaunch: true,
    appPackage: pylapp.tapster.calibration.android,
    appActivity: pylapp.tapster.calibration.android.MainActivity
  }

What is wrong with my input?
While researching I found out that some of those parameters are deprecated, but I didn’t find out what else I’m supposed to use.

Thanks for reading and have a nice day.

Windows users will need to escape the quotes in JSON passed on the command line: --default-capabilities “{\“app\”: \“myapp.app\”}”

https://appium.io/docs/en/writing-running-appium/default-capabilities-arg/

1 Like

Tried it with escaped quotes:

appium --pre-launch --default-capabilities ‘{
>> “app”: “C:/Users/Quaspiel/Desktop/tapsterbot-dev/tapsterbot-dev/calibration/android/calibration-android.apk”,
>> \“platformName\”: \“Android\”,
>> \“platformVersion\”: \“8.0.0\”,
>> \“deviceName\”: \“Galaxy7\”,
>> \“autoLaunch\”: \“true\”,
>> \“appPackage\”: \“pylapp.tapster.calibration.android\”,
>> \“appActivity\”: \“pylapp.tapster.calibration.android.MainActivity\”
>> }’

But it gives me a similar error:

C:\Program Files\nodejs\node_modules\appium\build\lib\main.js: error: argument "-dc/--default-capabilities": Invalid parseDefaultCaps value: {

After the Bracket, the error just ends.

on windows : --default-capabilities "{\"app\": \"myapp.app\"}"
it seems in your command line you put simple quote instead of double quote at begin/endPreformatted text

1 Like