How to start the Appium server from command prompt in MAC machine?

I am automating native mobile application using . 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:

  1. Launch Node.js command prompt
  2. Navigate till the Appium bin folder
  3. Use the command 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.

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.

String tellCommand = "tell application \"Terminal\" to do script \"/usr/bin/node_modules/appium/bin/appium.js";
        String parameters = " -p "+port;
        parameters += " "+ (fullReset ? "--full-reset" : "--no-reset")+"\"";
        tellCommand += parameters;

        String[] command = { "osascript", "-e",
        tellCommand };

        ProcessBuilder pBuilder = new ProcessBuilder(command);
        pBuilder.start();

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 -

  1. Go to https://nodejs.org/
  2. Download and install the latest stable version of node.js package in your mac
  3. Now open the terminal application
  4. Run the following command => npm install -g appium
  5. 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.
  6. If everything is in green ticks, run => appium & to start the appium server

Hope this helped.