DEV Community

Cover image for Install and Configure Appium on Mac
Khairun Nahar Nowrin
Khairun Nahar Nowrin

Posted on • Updated on

Install and Configure Appium on Mac

  1. Install Java
  2. Install home brew
  3. Install Android Studio
  4. Install IntelliJ IDEA, Eclipse or and other IDEA
  5. Download Appium https://github.com/appium/appium-desktop/releases https://medium.com/tauk-blog/quick-start-guide-for-setting-up-appium-on-an-m1-mac-a629a70a40cb
  6. Open Appium and click "START SERVER'

Image description

  1. After that server is running

Screen Shot 2022-10-31 at 12 52 24 PM

  1. Click on search button, it will redirect into https://github.com/appium/appium-inspector page.

Screen Shot 2022-10-31 at 12 53 23 PM

  1. Go to installation > release > 2022.9.1(latest one) > and download "Appium-Inspector-mac-2022.9.1.dmg" - https://github.com/appium/appium-inspector/releases/tag/v2022.9.1 , Check this tutorial -> https://www.youtube.com/watch?v=WZuS8qP45xY

Screen Shot 2022-10-31 at 12 54 52 PM

Image description
CONNECT REAL ANDROID MOBILE DEVICE ON MAC

  1. Java install on system. JAVA_HOME is set in environment variable command to Check Java version "java -version" , "javac -version"
  2. Need an Android Device and cable to connect. and can also download "Vysor" App from playstore to puts your Android on your desktop.
  3. ADD ENVIRONMENT VARIABLE *
`nano ~/.zshrc` or "bashrc"
Enter fullscreen mode Exit fullscreen mode
  • Then set
export ANDROID_HOME=/Users/FOLDER_NAME/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
Enter fullscreen mode Exit fullscreen mode
* After that run ─>
Enter fullscreen mode Exit fullscreen mode
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode
* NOTED THAT -> For find Android path can run command-
Enter fullscreen mode Exit fullscreen mode
which android
Enter fullscreen mode Exit fullscreen mode

And for JAVA_HOME run -

which java
Enter fullscreen mode Exit fullscreen mode
<img width="474" alt="Screen Shot 2022-10-31 at 1 46 59 PM" src="https://user-images.githubusercontent.com/32488952/198957543-299f84a0-7ba2-4e48-88e9-541c81e93dcb.png">
Enter fullscreen mode Exit fullscreen mode
  1. Enable Phone DEVELOPER MODE and USB Debugging.
  2. run command ->
adb devices
Enter fullscreen mode Exit fullscreen mode

and check device ID is displaying

Screen Shot 2022-10-31 at 1 54 18 PM

Create Project ( Eclipse ) reference tutorial -> https://www.youtube.com/watch?v=BEF-d1xjV4Q&list=PLhW3qG5bs-L8npSSZD6aWdYFQ96OEduhk&index=6

  1. Open Eclipse > click on file > select other > select Maven project.
  2. Go to pom.xml and add dependency (Maven / gradle) dependencies - https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java https://mvnrepository.com/artifact/io.appium/java-client

Create Project ( Android Studio ) reference tutorial -> https://www.youtube.com/watch?v=YecsinHl88A

  1. Open Android Studio > create project
  2. App > java > test > create file
  3. Go to gradle and add dependency dependencies - https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java https://mvnrepository.com/artifact/io.appium/java-client

Create Project ( IntelliJ ) reference tutorial -> https://www.youtube.com/watch?v=i1tQ1pjEFWw

Set capacity

  1. Run Appium server GUI
  2. Then run Appium Inspector. Set Remote host - 127.0.0.1, Remote Path - /wd/hub
  3. Set Desired Capabilities

cap.setCapability("deviceName", "OPPO A15");
cap.setCapability("udid", "8DIJRW5PZPGY5TRK");
cap.setCapability("platformName", "Android");
cap.setCapability("platformVersion", "10");
cap.setCapability("appPackage", "Package_name");
cap.setCapability("appActivity", "Activity_name");
cap.setCapability("ignoreHiddenApiPolicyError", true);
`

Image description

How to find app activity and app package check that video - https://www.youtube.com/watch?v=N7vY3cPSo8g&list=PLhW3qG5bs-L8npSSZD6aWdYFQ96OEduhk&index=9

Find face any error like "I can't find Disable Permission Monitoring on my device Samsung A52" Resolve this issue follow this step ->

"I have the same error, with my phone (Realme C3), I solved with the following way:
Step 1. First Enable Developer Option
Step 2. second step enable USB Debugging
And very important Step: Step 3. Search for "Disable Permission Monitoring" and Enable it."

If facing issue while running appium script on android devices, Follow this step

Stop appium server and execute below commands

  1. adb uninstall io.appium.uiautomator2.server
  2. adb uninstall io.appium.uiautomator2.server.test

Top comments (1)

Collapse
 
khairunnaharnowrin profile image
Khairun Nahar Nowrin

Install JDK using Homebrew: Once Homebrew is installed, you can install the JDK for ARM-based Macs by running the following command:
bash

brew install --cask temurin
Enter fullscreen mode Exit fullscreen mode

This will install the Temurin JDK, which is compatible with ARM-based Macs.
Verify Installation: After installation, you can verify that Java is installed by running:
bash

java -version
Enter fullscreen mode Exit fullscreen mode