Appium Beginner Tutorial 6 | How To Connect Real Android Device On Mac OS



FREE Courses –
Pre-requisites
1. Java installed on system
2. JAVA_HOME is set in environment variables command to check :
java -version
How to install java on Mac OS

3. An android mobile device
4. Cable to connect mobile device to computer system

Install homebrew –

Step 1 : Download android sdk
Way 1 : Download from…

31 Comments

  1. Every videos from you are simply awesome, In every videos you are just proving for keeping your channel name as Step by step✌🏻… Great work dude

  2. Hu raghav, i am unable to open uiautomatorviewer
    am getting following error" -Djava.ext.dirs=..libx86_64;..lib is not supported. Use -classpath instead." i have set all the path but still facing the issue pls can u help me out am using java 13sdk

  3. Hi Raghav,
    I have been following your video and i have got stuck running the code. im getting below error can you help me here thanks

    An unknown server-side error occurred while processing the command. Original error: Could not find 'aapt' in ["/usr/local/share/android-sdk/platform-tools/aapt","/usr/local/share/android-sdk/emulator/aapt","/usr/local/share/android-sdk/tools/aapt","/usr/local/share/android-sdk/tools/bin/aapt"]. Do you have Android Build Tools installed at '/usr/local/share/android-sdk'?

  4. Hi Raghav,

    Is this possible that I have a real IOS device and connect to my windows PC?

  5. Ankits-MacBook-Air:bin ankitnigam$ cd /Users/ankitnigam/Downloads/tools/bin
    Ankits-MacBook-Air:bin ankitnigam$ sdkmanager "platform-tools" "platforms;android-28"
    -bash: sdkmanager: command not found
    each tym this is visible pls tell me how to resolve

  6. While running the command for platform tools:
    apa-00020:bin vinayg$ sdkmanager "platform-tools" "platforms;android-28"
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    … 5 more
    Let me know

  7. Hi Raghav, Thanks for this video, explained nicely. Any videos about Appium with c# and specflow?

  8. sir , if I don't have android device .How can I connect android emulator to Appium ?

  9. Hi Raghav, Thanks for the video. I FOLLOWED ALL THE STEPS and working before installing platform tools.
    When i execute
    i am getting sdkmanager "platform-tools" "platforms;android-28"

    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    … 5 more
    PLEASE HELP ME IN THIS REGARD.

  10. @Raghav Pal – For those of us using JAVA 11, there is an error at the step where you run the command:
    sdkmanager "platform-tools" "platforms;android-28"

    Would you happen to know of a solution? StackOverflow is not very helpful (too many solutions that don't work).

  11. I think the issue you were having at 22:50 was because the ANDROID_HOME path wasn't in quotes "/usr/local/share/android-sdk"

  12. sdkmanager "platform-tools" "platforms;android-28"
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    … 5 more

  13. Hi Raghav, i am getting the below error while running test ,

    org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not find 'aapt' in ["/usr/local/share/android-sdk/platform-tools/aapt","/usr/local/share/android-sdk/emulator/aapt","/usr/local/share/android-sdk/tools/aapt","/usr/local/share/android-sdk/tools/bin/aapt"]. Do you have Android Build Tools installed at '/usr/local/share/android-sdk'?

  14. sdkmanager "platform-tools" "platforms;android-28"

    ERROR: JAVA_HOME is set to an invalid directory: C:Program FilesJavajdk1.8.0_201bin

    Please set the JAVA_HOME variable in your environment to match the

    location of your Java installation.

  15. Hello, I am having the exact same issue like you where it cant find the path for the platform tool, and i tried like you to rewrite the " "/ double quotes but it still not finding it. can you please help?
    Thanks

  16. Getting an error saying " Could not find ' aapt' in PATH. Please set the ANDROID_HOME environment variable with the Android sdk root directory path. Please suggest a solution for this. Already done all setup explained in this video successfully.

  17. Hello,
    Could you please be so kind to help me with the following problem?
    I run all steps from your video and all seemed to work fine except one thing: when I use Samsung device with Chrome ver.75 my test works fine, when I plugged next Android phone with Chrome above v.75, I have the following error: "Original error: Unable to automate Chrome version because it is too old for this version of Chromedriver.Chrome version on the device: Chrome/77.0.3865.92"
    How is this happening? I found a chromedriver for Appium (under node_modules) and changed it to one of the newest one (v.76), but it didn’t help. Then added “System.setProperty…” but it also didn’t help :/
    My code:
    DesiredCapabilities dc = new DesiredCapabilities();
    dc.setCapability(MobileCapabilityType.DEVICE_NAME, "xxx");
    dc.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
    dc.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");

    // System.setProperty("webdriver.chrome.driver","/Users/beatasadek/Downloads/chromedriver.exe");
    AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub&quot;),dc);
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    driver.get("https://www.facebook.com/&quot😉;

    I use Appium desktop on Mac OS. I will appreciate any advice on this.
    Thanks,
    Beata

  18. there is an error occurring when i ran the command from android studio website i have java 12 version and error is mentioning that class not found ……… what to do now

  19. Thanks for this video @Raghav Pal. I hope you upload soon a video how we connect Real iOS devices on Mac OS.

  20. Thanks for the video Raghav. I have followed the steps clearly but still, I couldn't list any device using "abd devices" command on my mac. Still its showing "command not found" Can you please help me out in this reg?

  21. HI, this both command not working
    1.brew install android-sdk
    2. brew cask install android-sdk
    any suggestion? Both command reply command not found
    Thank you

  22. MANNN this is soooo Long . I just want to empty my android phone on my mac.
    For some reason my dash is asking for a password … witch I am having a hard time to find on the brew site …

  23. je suis francais, merci pour tout ton travail de recherche tu est un bon professeur continue comme ca, merci

Leave a Reply

Your email address will not be published. Required fields are marked *