Start appium server from terminal on MAC Machine

start appium server from terminal on MAC Machine

Is it a question?
Try:

appium

yes, you are right? I am able to launch Appium UI through terminal but when I try to start Appium server through Terminal. I am not getting success. Can you share the steps as well as code so That I could go ahead.

do first in terminal:

brew install node # get node.js
npm install -g appium # get appium
npm install wd # get appium client

2 Likes

/Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js --address 127.0.0.1 --chromedriver-port 9516 --bootstrap-port 4725 --no-reset --local-timezone --command-timeout 7200 --session-override --debug-log-spacing --platform-version 9.0 --platform-name iOS --app /Users/chennareddy/u/apps/TestApp/build/release-iphonesimulator/Handstand/Handstand.app --show-ios-log --device-name iPhone-6s --native-instruments-lib --orientation Portrait

Hi,
I have installed Appium via this command successfully. but when I hit ā€œappiumā€ on terminal it gives
below response.
$ appium
-bash: appium: command not found.
Can you help with this?

1 Like

@Chhavi_Singh have you installed appium via npm? ā€œnpm install -g appiumā€
If not, then install it with npm and open new terminal… type ā€œappiumā€

I have installed via ā€œnpm install -g appiumā€ and it successfully installed… after than I enter appium on terminal… it prompt ā€œcommand not foundā€

Open a new terminal and cd /usr/local/bin/ and check if appium executable present there?

No…
but I have used ā€œ/Users/xxxxxx/.npm-global/lib/node_modules/appium/build/lib/main.jsā€. Is it the same thing?
Actually I want to start the appium programmatically…

/usr/local/bin/appium is your soft link to this ā€œmain.jsā€, this soft link would get created automatically when we install appium using npm. Anyways, you can try re-installing appium:
Uninstall command: ā€œnpm uninstall -g appiumā€
Install Command: ā€œnpm install -g appiumā€

1 Like

:frowning: no luck.
PFB logs.
administorsmini:~ chhavi.singh$ npm uninstall -g appium
removed 535 packages in 14.067s
administorsmini:~ chhavi.singh$ npm install -g appium
/Users/chhavi.singh/.npm-global/bin/appium → /Users/chhavi.singh/.npm-global/lib/node_modules/appium/build/lib/main.js

[email protected] install /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-chromedriver
node install-npm.js

info Chromedriver Install Installing Chromedriver version ā€˜2.38’ for platform ā€˜mac’ and architecture ā€˜64’
info Chromedriver Install Opening temp file to write chromedriver_mac64 to…
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.com/2.38/chromedriver_mac64.zip…
info Chromedriver Install Writing binary content to /var/folders/18/mn57ht2n65d987s_d25rx5mc52kmmy/T/2018425-8105-1brxsw5.k3lh/chromedriver_mac64.zip…
info Chromedriver Install Extracting /var/folders/18/mn57ht2n65d987s_d25rx5mc52kmmy/T/2018425-8105-1brxsw5.k3lh/chromedriver_mac64.zip to /var/folders/18/mn57ht2n65d987s_d25rx5mc52kmmy/T/2018425-8105-1brxsw5.k3lh/chromedriver_mac64
info Chromedriver Install Creating /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac…
info Chromedriver Install Copying unzipped binary, reading from /var/folders/18/mn57ht2n65d987s_d25rx5mc52kmmy/T/2018425-8105-1brxsw5.k3lh/chromedriver_mac64/chromedriver…
info Chromedriver Install Writing to /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver…
info Chromedriver Install /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver successfully put in place

[email protected] install /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver
node ./bin/install.js

dbug AndroidDriver Getting Java version
info AndroidDriver Java version is: 1.8.0_171
info Selendroid Ensuring /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
info Selendroid Downloading Selendroid standalone server version 0.17.0 from http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar → /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
info Selendroid Writing binary content to /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
info Selendroid Selendroid standalone server downloaded
info Selendroid Determining AndroidManifest location
info Selendroid Determining server apk location
info Selendroid Extracting manifest and apk to /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download
info Selendroid Copying manifest and apk to /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid
info Selendroid Cleaning up temp files
info Selendroid Fixing AndroidManifest icon bug

[email protected] install /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/fsevents
node install

[fsevents] Success: ā€œ/Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.nodeā€ already installed
Pass --update-binary to reinstall or --build-from-source to recompile

[email protected] install /Users/chhavi.singh/.npm-global/lib/node_modules/appium/node_modules/heapdump
node-gyp rebuild

CXX(target) Release/obj.target/addon/src/heapdump.o
SOLINK_MODULE(target) Release/addon.node

  • [email protected]
    added 535 packages in 136.742s
    administorsmini:~ chhavi.singh$ appium
    -bash: appium: command not found
    administorsmini:~ chhavi.singh$

As per logs, your soft link is created in this path ā€œ/Users/chhavi.singh/.npm-global/bin/appiumā€ , So now you can add ā€œ/Users/chhavi.singh/.npm-global/bin/ā€ in your bash profile and then open new terminal and try running appium. It will work.

Thanks for the help… It is resolved now…

most wc!
for updates and learnings on Appium, subscribe this youtube channel: https://www.youtube.com/channel/UCb4jv3Oor88-EtD7NYR1Riw

Hi @Swapan_Chhabra

Thanks for you help.
It helped me to resolve my issue also to start my Appium from Terminal.

Thanks
Dileep

resolve by uninstalling and again installing with using --force

Unable to install appium

32 vulnerabilities (24 moderate , 3 high , 5 critical )

To address issues that do not require attention, run:

npm audit fix

To address all issues possible (including breaking changes), run:

npm audit fix --force

Some issues need review, and may require choosing

a different dependency.