Setup and Configure Appium on Mac Operating System

Modified on Wed, 17 Apr at 12:27 PM

The following instructions outline the process of setting up an Appium instance on a macOS machine and configuring it to manage iOS devices.


Prerequisites 

  • A macOS machine where the Appium server will be running. The supported Appium version is 2.x. To setup Appium server, click here.
  • The XCUITest driver must be installed on the Appium server. For more information, see the driver description in the Appium documentation: The XCUITest Driver for iOS.
  • Your Python computer must have network access to the macOS machine.

Step1 : Install Homebrew, Carthage, and Node.js

  1. Install Homebrew (it’s a package management system that makes it easier to install software on Mac OS machines).
  2. To install Homebrew, click here and follow the instructions.
  3. Install Carthage (a dependency manager). To do this, open the Terminal window and run the following command:
    brew install carthage
  4. Node.js allows developers to use JavaScript on the server side. Install Node.js and NPM. To do this, run the following command:
    brew install node

Step 2:  Install Java

  1. Download the JDK from this website:
  2. Run the downloaded installer and follow the instructions you will see on screen.
  3. Run the following command in the Terminal:
    /usr/libexec/java_home --v
    The previous command displays the location of the JDK on your computer similar to the following path: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home.  Copy the path.
  4. Open your .bash_profilefile in an editor and add the following two lines to it:
    • export JAVA_HOME="copied-path-to-JDK-directory"
    • export PATH=$JAVA_HOME/bin:$PATH
  5. Save the changes.
  6. Restart the Terminal to grab the new .bash_profile settings.

Step3: Install Appium

To Install Appium with npm, run the following command in the Terminal window:
npm install -g appium


Tip: It is recommended that you install the Appium Doctor in addition to Appium. It will help you fix issues with Appium and iOS settings. To install the Appium Doctor, run the following command in Terminal: npm install -g appium-doctor


Step 4: Install Xcode and Xcode command-line tools

  1. Download Xcode:
    Run the installer and follow the instructions you will see on the screen.
  2. To install Xcode via command-line tools, run the following command in the Terminal:
    xcode-select --install

Step5: Install WebDriverAgent 

WebDriverAgent is a WebDriver version for iOS. It serves for controlling iOS devices and apps remotely. You can find it in the following directory:

If you have installed Appium via Node.js: /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent


To install:

  1. In the Terminal window, go to the directory specified in the previous step and run the following command:
    mkdir -p Resources/WebDriverAgent.bundle
    ./Scripts/bootstrap.sh -d
  2. Open the WebDriverAgent.xcodeproj project in Xcode (you can find the project in one of the directories specified in the previous step).






Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article