Start appium server from terminal on MAC Machine


#1

start appium server from terminal on MAC Machine


#2

Is it a question?
Try:

appium

#3

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.


#4

do first in terminal:

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


#5

/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


#6

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?


#7

@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”


#8

I have installed via “npm install -g appium” and it successfully installed… after than I enter appium on terminal… it prompt “command not found”


#9

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


#10

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…


#11

/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”


#12

: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$

#13

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.


#14

Thanks for the help… It is resolved now…


#15

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


#16

Hi @Swapan_Chhabra

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

Thanks
Dileep