I got an error in appium while running the script through Eclipse

Launching Appium server with command: C:\Program Files\Appium\node.exe lib\server\main.js --address http://0.0.0.0: --port 4723 --app --app-pkg --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
usage: main.js [-h] [-v] [–shell]
[–localizable-strings-dir LOCALIZABLESTRINGSDIR] [–app APP]
[–ipa IPA] [-U UDID] [-a ADDRESS] [-p PORT]
[-ca CALLBACKADDRESS] [-cp CALLBACKPORT] [-bp BOOTSTRAPPORT]
[-k] [-r BACKENDRETRIES] [–session-override] [–full-reset]
[–no-reset] [-l] [-lt LAUNCHTIMEOUT] [-g LOG]
[–log-level {info,info:debug,info:info,info:warn,info:error,warn,warn:debug,warn:info,warn:warn,warn:error,error,error:debug,error:info,error:warn,error:error,debug,debug:debug,debug:info,debug:warn,debug:error}]
[–log-timestamp] [–local-timezone] [–log-no-colors]
[-G WEBHOOK] [–native-instruments-lib]
[–app-pkg ANDROIDPACKAGE] [–app-activity ANDROIDACTIVITY]
[–app-wait-package ANDROIDWAITPACKAGE]
[–app-wait-activity ANDROIDWAITACTIVITY]
[–android-coverage ANDROIDCOVERAGE] [–avd AVD]
[–avd-args AVDARGS]
[–device-ready-timeout ANDROIDDEVICEREADYTIMEOUT] [–safari]
[–device-name DEVICENAME] [–platform-name PLATFORMNAME]
[–platform-version PLATFORMVERSION]
[–automation-name AUTOMATIONNAME] [–browser-name BROWSERNAME]
[–default-device] [–force-iphone] [–force-ipad]
[–language LANGUAGE] [–locale LOCALE]
[–calendar-format CALENDARFORMAT] [–orientation ORIENTATION]
[–tracetemplate AUTOMATIONTRACETEMPLATEPATH]
[–instruments INSTRUMENTSPATH] [–show-sim-log]
[–show-ios-log] [–nodeconfig NODECONFIG] [-ra ROBOTADDRESS]
[-rp ROBOTPORT] [–selendroid-port SELENDROIDPORT]
[–chromedriver-port CHROMEDRIVERPORT]
[–chromedriver-executable CHROMEDRIVEREXECUTABLE]
[–use-keystore] [–keystore-path KEYSTOREPATH]
[–keystore-password KEYSTOREPASSWORD] [–key-alias KEYALIAS]
[–key-password KEYPASSWORD] [–show-config] [–no-perms-check]
[–command-timeout DEFAULTCOMMANDTIMEOUT] [–keep-keychains]
[–strict-caps] [–isolate-sim-device] [–tmp TMPDIR]
[–trace-dir TRACEDIR] [–intent-action INTENTACTION]
[–intent-category INTENTCATEGORY] [–intent-flags INTENTFLAGS]
[–intent-args OPTIONALINTENTARGUMENTS]
[–dont-stop-app-on-reset] [–debug-log-spacing]
[–suppress-adb-kill-server] [–async-trace]

main.js: error: argument “–app”: Expected one argument. null

Appium server process ended

Testng may be of some older version

There may be some issue with testng
Try installiing from eclipse marketplace

If testng does not work try run ‘static void main’ way

Your code seems correct and Make sure app package and app activity is correct

Thank you Sir for solutions

1 Like

Hi Prem,

go to play store, and install easy back up software in your phone.
with this you can take back up of the applications. it will save the .apk file internal or external storage. copy that to the desk top.

Did Your code got executed?

No Sir, I am getting the Same error again

Thanks Narendra, but I given path and activity, but my code is not working at all. So what I have to do now

Try to run without testng and run in a new java project

Hi Prem,

will you please send me app package and activity you have found.

App package - com.miui.calculator
App Activity - com.miui.calculator.cal.NormalCalculatorActivity

null
no protocol: 127.0.0.1:4723/wd/hub
java.net.MalformedURLException: no protocol: 127.0.0.1:4723/wd/hub
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at appiumtests.calculatorTest.openCalculator(calculatorTest.java:46)
at appiumtests.calculatorTest.main(calculatorTest.java:23)