Setup Appium on Mac OS for Android and iOS App Automation [ 2021 Update]

Steps to setup Appium with Java (OpenJDK version “1.8.0_265") With Android Studio(“4.1”) and Xcode (“12.1”)on MAC os Catalina (10.15.7)

$ chsh -s /bin/bash
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
$ java -version
https://developer.android.com/studio
  1. Search for Xcode.
  2. Click on the Install Button and wait for install to finish.
$ xcode-select --install  
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
$ sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
$ sudo xcodebuild -license accept
$ brew install carthage
$ brew install node
$ node -v
v14.14.0
$ npm -v
6.14.8
$ npm install -g appium
$ npm install wd
$ npm install -g appium-doctor
$ npm install -g appium@1.1x.x
$ nano .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
source ~/.bash_profile
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
  1. tools.
  2. build-tools.
$ nano .bash_profile
export ANDROID_HOME=/Users/kchetan/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/platform-tools/bin:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
export PATH=$ANDROID_HOME/build-tools/30.0.2:$PATH
export PATH=$ANDROID_HOME/build-tools/30.0.2/bin:$PATH
source ~/.bash_profile
echo $ANDROID_HOME
/Users/kchetan/Library/Android/sdk
$ npm i -g webpack
$ brew install libimobiledevice
$ npm install -g ios-deploy
$ brew install cmake
$ npm install -g opencv4nodejs
$ brew install wix/brew/applesimutils
$ brew install ios-webkit-debug-proxy
$ brew cask install osxfuse
  • Apps: Mount sandbox container or document directory of an app
  • Jailbreak: Mount root filesystem on jailbroken devices (requires AFC2 service)
  • Browse: Allows to retrieve a list of installed file-sharing enabled apps
$ brew install ifuse
$ npm i -g mjpeg-consumer
$ brew install ffmpeg
$ brew install lyft/formulae/set-simulator-location
  • Simple Primitives: idb exposes granular commands so that sophisticated workflows can be sequenced on top of them. This means you can use idb from an IDE or build an automated testing scenario that isn't feasible with default tooling. All of these primitives aim to be consistent across iOS versions and between iOS Simulators and iOS Devices. All the primitives are exposed over a cli, so that it easy to use for both humans and automation.
  • Exposing missing functionality: Xcode has a number of features that aren’t available outside it’s user interface. idb leverages many of Private Frameworks that are used by Xcode, so that these features can be in GUI-less automated scenarios.
$ brew tap facebook/fb
$ brew install idb-companion
$ pip3.6 install fb-idb
https://github.com/google/bundletool/releases
nano .bash_profileexport PATH=$ANDROID_HOME/bundle-tool:$PATHsource .bash_profile
appium-doctor

Verify if you see the following message after running the Appium doctor command.

info AppiumDoctor Everything looks good, bye!

$ appium

Cheers 🍻 🥂 🍺

Automation Test Engineer by Profession, Traveller by the Weekend

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store