Install Environment on macOS


Table of contents

  1. General
    1. Homebrew
    2. Java
      1. JDK
      2. Java Home
    3. Git
    4. IntelliJ IDEA
    5. NodeJS
    6. Allure Commandline
    7. GitHub Desktop
  2. Advance
    1. Xcode
      1. IDE
      2. SDK
      3. Simulator
    2. Android Studio
      1. IDE
      2. SDK
      3. Emulator
      4. Android Home
    3. Appium
      1. Server
      2. Driver
      3. Plugin
      4. Inspector

πŸ”² β†’ Optional
βœ… β†’ Required
πŸ”˜ β†’ Pick One
ℹ️ β†’ Information


General


Homebrew


https://ngoanh2n.github.io/blog/env/homebrew

βœ… Installation

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

πŸ”² Validation

brew --version

Java


JDK

https://ngoanh2n.github.io/blog/env/java#macos-jdk

βœ… Installation

πŸ”˜ Eclipse Temurin

brew install --cask temurin21

πŸ”˜ Amazon Corretto

brew install --cask corretto21

Java Home

https://ngoanh2n.github.io/blog/env/java#macos-java-home

βœ… Setting

πŸ”˜ Latest Version

echo "export JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.zshrc

πŸ”˜ Specific Version

echo "export JAVA_HOME=\$(/usr/libexec/java_home -v 17)" >> ~/.zshrc

πŸ”² Validation

echo $JAVA_HOME
java --version

ℹ️ Location

πŸ”˜ Eclipse Temurin

/Library/Java/JavaVirtualMachines/temurin-XX.jdk

πŸ”˜ Amazon Corretto

/Library/Java/JavaVirtualMachines/amazon-corretto-XX.jdk

Git


https://ngoanh2n.github.io/blog/env/git

βœ… Installation

brew install git

πŸ”² Validation

git --version

IntelliJ IDEA


https://ngoanh2n.github.io/blog/env/intellij-idea

βœ… Installation

  1. Visit https://www.jetbrains.com/idea/download/?section=mac
  2. Click Download at IntelliJ IDEA Community Edition
  3. Open ideaIC-XXX.X.X.dmg in Downloads
  4. Drag IntelliJ IDEA CE to the Applications

NodeJS


https://ngoanh2n.github.io/blog/env/nodejs#macos

πŸ”² Installation

brew install node@20

πŸ”² Validation

node --version
npm --version

ℹ️ Location

/usr/local/lib/node_modules
/usr/local/lib/node_modules/npm/node_modules

Allure Commandline


https://ngoanh2n.github.io/blog/env/allure-commandline

πŸ”² Installation

npm install --global allure-commandline

πŸ”² Validation

allure --version

ℹ️ Location

/usr/local/lib/node_modules/allure-commandline

GitHub Desktop


https://ngoanh2n.github.io/blog/env/github-desktop

πŸ”² Installation

  1. Visit https://desktop.github.com
  2. Click Download for macOS
  3. Open GitHubDesktop-xxx.zip in Downloads
  4. Move GitHub Desktop to the Applications

Advance


Xcode


IDE

https://ngoanh2n.github.io/blog/env/xcode#ide

βœ… Installation

ℹ️ Prerequisites

  • macOS machine with version 10.15.4 or upper
  • Minimum space requirement for Xcode download and installation
  • An Apple ID
  • Membership in the Apple Developer Program (For Real Devices)
  1. Visit https://xcodereleases.com
  2. Open Xcode_XX.X.xip
  3. Move Xcode to the Applications

SDK

https://ngoanh2n.github.io/blog/env/xcode#sdk

βœ… Installation

  1. Open Xcode
  2. Select the platforms > Download & Install
  3. Enter password to acquire admin privileges > OK
  4. Open Locations
    Navigation route: Xcode > Settings... > Locations

Simulator

https://ngoanh2n.github.io/blog/env/xcode#simulator

βœ… Installation

  1. Open Xcode
  2. Open Platforms
    Navigation route: Xcode > Settings... > Platforms
  3. Open simulator picker: Add icon > iOS...
  4. Select desired simulators > Download & Install
  5. Open a siumlator
    opem -a simulator
    

Android Studio


IDE

https://ngoanh2n.github.io/blog/env/android-studio#ide-macos

βœ… Installation

  1. Visit https://developer.android.com/studio
  2. Click Download Android Studio Xxx
  3. Select I have read and agree with the above terms and conditions
  4. Click Mac with Intel chip or Mac with Apple chip
  5. Open android-studio-xxx.x.x-mac.dmg in Downloads
  6. Drag Android Studio to the Applications

SDK

https://ngoanh2n.github.io/blog/env/android-studio#sdk

βœ… Installation

πŸ”˜ Setup Wizard

When opening for the first time after installed Android Studio.

  1. Open Android Studio
  2. Welcome > Next
  3. Install Type > Next
  4. Verify Settings > Next
  5. License Agreement > Accept licenses > Finish
  6. Downloading Components > Finish

πŸ”˜ Download

When missing Android SDK Components. That means, you have NOT installed environment yet as above.

βœ… SDK Manager

  1. Open Android Studio
  2. Open Settings
    Navigation route: More Actions > SDK Manager

βœ… Settings

βœ… SDK Platforms

β˜‘ Show Package Details
β˜‘ Android XX.X
Β Β Β  β˜‘ Android SDK Platform XX
Β Β Β  β˜‘ Sources for Android XX

βœ… SDK Tools

β˜‘ Show Package Details
β˜‘ Android SDK Build-Tools XX
Β Β Β  β˜‘ XX.0.0
β˜‘ Android Emulator
β˜‘ Android SDK Platform-Tools

Emulator

https://ngoanh2n.github.io/blog/env/android-studio#sdk

βœ… Creating

βœ… Virtual Device Manager

  1. Open Android Studio
  2. Open Device Manager
    Navigation route: More Actions > Virtual Device Manager

βœ… Virtual Device Configuration

  1. Create Virtual Device
  2. Select Device > Next
  3. Download System Image: Click Download icon
  4. Agree License: Accept > Next
  5. Complete Requested Actions: Finish
  6. Select System Image > Next
  7. Verify Configuration > Finish
  8. Verify Virtual Devices

Android Home

https://ngoanh2n.github.io/blog/env/android-studio#android-home-macos

βœ… Setting

By default, SDK location is /Users/{USER}/Library/Android/sdk.
The environment variables that need to be set in the following:

  • ANDROID_HOME
  • Tools:
    • Platform Tools: adb
    • Build Tools: apksigner
    • Command-Line Tools: avdmanager, sdkmanager, apkanalyzer
    • Emulator: emulator, mksdcard
echo "export ANDROID_HOME=/Users/{USER}/Library/Android/sdk" >> ~/.zshrc
echo "export PATH=\$PATH:\$ANDROID_HOME/platform-tools" >> ~/.zshrc
echo "export PATH=\$PATH:\$ANDROID_HOME/build-tools/{API_LEVEL}" >> ~/.zshrc
echo "export PATH=\$PATH:\$ANDROID_HOME/cmdline-tools/{CMD_TOOLS_VERSION}/bin" >> ~/.zshrc
echo "export PATH=\$PATH:\$ANDROID_HOME/emulator" >> ~/.zshrc

β˜‘ Replace {USER} by your current username
β˜‘ Replace {API_LEVEL} (E.g. 34.0.0)
β˜‘ Replace {CMD_TOOLS_VERSION} (E.g. 13.0)


πŸ”² Validation

source ~/.zshrc
echo $ANDROID_HOME
adb --version

Appium


Server

https://ngoanh2n.github.io/blog/env/appium#server

βœ… Installation

npm install --global appium

πŸ”² Validation

appium --version

ℹ️ Location

/Users/{USER}/.appium

Driver

https://ngoanh2n.github.io/blog/env/appium#driver-macos

βœ… Installation

Suppose I want to setup environment on macOS machine for testing iOS app, macOS app and Android app.

  1. iOS app
    appium driver install xcuitest
    
  2. macOS app
    appium driver install mac2
    
  3. Android app
    appium driver install uiautomator2
    

Or refer to the Appium Ecosystem’s Drivers for installing appropriate drivers to your testing environment.


πŸ”² Validation

appium driver list --installed

πŸ”² Doctor

appium driver doctor xcuitest
appium driver doctor mac2
appium driver doctor uiautomator2

ℹ️ Location

/Users/{USER}/.appium/node_modules/appium-xcuitest-driver
/Users/{USER}/.appium/node_modules/appium-mac2-driver
/Users/{USER}/.appium/node_modules/appium-uiautomator2-driver

Plugin

https://ngoanh2n.github.io/blog/env/appium#plugin

πŸ”² Installation

πŸ”² Images

Plugin for image comparison and finding elements by image.

appium plugin install images

Usage

The plugin must be explicitly activated when launching the Appium server.

appium --use-plugins=images

πŸ”² Validation

appium plugin list --installed

ℹ️ Location

/Users/{USER}/.appium/node_modules/@appium/images-plugin

Inspector

https://ngoanh2n.github.io/blog/env/appium#inspector

βœ… Installation

Appium Inspector is released in two formats:

πŸ”˜ Desktop application

  1. Visit https://github.com/appium/appium-inspector/releases
  2. Click Appium-Inspector-mac-xxxx.x.x.dmg
  3. Open the Appium-Inspector-mac-xxxx.x.x.dmg in Downloads
  4. Drag Appium Inspector and drop to Applications

πŸ”˜ Web application

Appium Inspector is hosted by Appium Pro. You can inspect your app on this site directly at https://inspector.appiumpro.com.