I am automating ios native mobile application using appium. Until now I was launching the server from the Appium GUI by clicking on the Launch button. Now I want to start the server from a command prompt.
I was able to do the same in Windows machine by following the below steps:
node appium
I got blocked on how to start the Node.js command prompt on a Mac. Can you pleases tell me how I can start the Appium server from a command prompt on a Mac.
Run the following command => npm install -g appium This should install Appium in your system with global privileges. After installation of appium, you can run the command => appium-doctor in the same terminal window to verify if everything is installed properly. If everything is in green ticks, run => appium & to start the appium server
Now we can kick up an Appium server, either by running it from the command line like so (assuming the NPM install was successful): Or by clicking the huge Start Server button inside of Appium Desktop.
if you used npm install -g appium then you should be able to directly open one with the command Or you can still navigate to the folder of your node_modules and into appium and go with if you want to have additional server flags, all are available at their site with documentations. Show activity on this post.
The server port is what the client connects to and communicates with Appium. The default server port is 4723. When you connect to the client machines, you should specify this server port. To change the server port, click on Advanced Tab and you will see a screen with server configuration settings.
if you used npm install -g appium then you should be able to directly open one with the command
appium //plus any server args you want ex: appium -p 4474
Or you can still navigate to the folder of your node_modules and into appium and go with
node . //plus any server args you want
if you want to have additional server flags, all are available at their site with documentations.
Open the terminal and type in the following command
appium --address 127.0.0.1 --port 4723
Press enter then it will register itself to 127.0.0.1 and will listen 4723 port. You can extend this command by adding app type etc.
Hope this will help you
cheers
/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
To start appium in MAC, all you need to do is to type => appium & in the terminal application. In order for the above command to work, you have to install appium in terminal mode. However there are 2 ways of doing it, one is with HomeBrew and the other directly with Node.js . You can find the tutorial of installing HomeBrew online. Follow the steps below to install it directly with node.js -
Hope this helped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With