4 | Appium Step by Step | How to create Android Virtual Device

Поділитися
Вставка
  • Опубліковано 10 чер 2024
  • Android Virtual Device (AVD) Setup for Automation
    00:00 Intro
    00:56 How to create and start AVD (emulator) with Android Studio GUI App
    02:17 On Android Studio goto Virtual Device Manager > Create new virtual device
    03:18 Select device configuration and hardware (name, RAM, storage etc.)
    13:31 Check the emulator is available in Device Manager
    (Device manager will show all connected devices, virtual and physical)
    14:11 Start Stop Android Virtual Device (AVD)
    16:40 How to create and start AVD (Emulator) without Android Studio
    17:15 Set ANDROID_HOME and PATH env variables Ref: • 2 | Appium Step by Ste...
    20:53 Run commands
    $ sdkmanager.bat --list
    Use sdkmanager to get required packages like platform-tools, platforms, build-tools
    This can be done in a single command e.g.
    $ sdkmanager.bat “platform-tools” "platforms;android-33" “build-tools;33.0.0”
    // 33 is the API level of your android device os
    Or can be done in separate commands, e.g.
    $ sdkmanager.bat "build-tools;33.0.0"
    $ sdkmanager.bat "platforms;android-33"
    Get the system image that you want to use for the AVD (Android Virtual Device)
    $ sdkmanager.bat "system-images;android-33;google_apis;x86_64"
    $ sdkmanager.bat "sources;android-33" (can skip this)
    All these folders should automatically go in the ANDROID_HOME folder, else you can manually place them there
    Add path of folders platforms, platform-tools and emulator in Path env variable
    32:35 Use avdmanager commands to create AVD
    (available in cmdline-tools/bin, same place where sdkmanager is)
    avdmanager
    avdmanager list
    avdmanager list avd
    avdmanager create avd -n MyAVD1 -k “system-images;android-33;google_apis;x86_64”
    Here
    -n is the name of the AVD, we can give any name as you like, can also use --name
    -k is the system image that we downloaded using sdkmanager above, can also use --package
    (using this command - sdkmanager "system-images;android-33;google_apis;x86_64" )
    Can also give the id in -d flag
    avdmanager create avd -n MyAVD1 -d 17 -k “system-images;android-33;google_apis;x86_64”
    The id for a specific device can be referred by running avdmanager list
    37:46 Start AVD using emulator commands
    emulator -list-avds
    emulator -avd MyAVD1
    Can also start AVD with a specific resolution (size) using -skin option
    emulator -avd MyAVD1 -skin 450x750
    On Mac with Apple M1 M2 chip we can get system images with ARM64 architecture
    system-images;android-UpsideDownCakePrivacySandbox;google_apis_playstore;arm64-v8a
    49:56 Other options to use Android Virutal Device (emulators)
    50:26 Cloud Devices
    52:44 Next Steps
    Document - docs.google.com/document/d/e/...
    All Free Tutorials 🟢 AutomationStepByStep.com/
    how to create avd (android emulators) on windows
    how to create avd (android emulators) on mac os
    how to use sdkmanager
    how to use avdmanager
    Commands to create android emulator
    All Parts - • Appium 2 Beginner Tuto...
    ▬▬▬▬▬▬▬
    Share with all who may need this
    If my work has helped you, consider helping any animal near you, in any way you can
    Never Stop Learning
    Raghav Pal
    ▬▬▬▬

КОМЕНТАРІ • 22

  • @techforyou6969
    @techforyou6969 Місяць тому

    Thankyou so much sir , great work

  • @reviewkiemtiencucde825
    @reviewkiemtiencucde825 Місяць тому

    the video very beautiful, very well, thank you for sharing

  • @STD2580
    @STD2580 Місяць тому +1

    Hi Raghav, thanks for the series.
    There are only 4 videos on this series. When do we get remaining 3 videos. I am looking for iOS setup

    • @RaghavPal
      @RaghavPal  Місяць тому +1

      The three remaining videos will come this week and I will start on iOS setup from next week

  • @sajithdilshan2936
    @sajithdilshan2936 Місяць тому

    super !!

  • @nekkantimahalaxmi1906
    @nekkantimahalaxmi1906 Місяць тому

    Thank you raghavan. I am unable to open UI automator in Mac. Getting error as "SWT folder '/opt/homebrew/Caskroom/android-sdk/4333796/tools/lib/aarch64' does not exist.
    Please export ANDROID_SWT to point to the folder containing swt.jar for your platform." Could you please help on this

    • @RaghavPal
      @RaghavPal  Місяць тому

      Nekkanti
      Let's troubleshoot this step by step:
      1. Verify Android SDK Installation:
      - First, ensure that you have the Android SDK installed on your Mac. You can download it from the official Android Studio website.
      - Make sure you've set up the `ANDROID_HOME` environment variable correctly. This variable should point to the location where your Android SDK is installed.
      2. Check the Location of SWT Folder:
      - The error message indicates that the SWT folder is missing. Let's verify its location.
      - Open a terminal window and run the following command to find the location of the `swt.jar` file:
      ```
      find /opt/homebrew/Caskroom/android-sdk/ -name swt.jar
      ```
      - If the file is found, note down its path.
      3. Export ANDROID_SWT Environment Variable:
      - Export the `ANDROID_SWT` environment variable to point to the folder containing `swt.jar`. Replace `` with the actual path you found in step 2:
      ```
      export ANDROID_SWT=
      ```
      - You can add this line to your shell profile (e.g., `.bashrc`, `.zshrc`, or `.profile`) to make it persistent across terminal sessions.
      4. Restart UI Automator:
      - Close any open instances of UI Automator.
      - Open a new terminal window and try running UI Automator again:
      ```
      uiautomatorviewer
      ```
      - If everything is set up correctly, the UI Automator Viewer should launch without errors.
      5. Additional Troubleshooting:
      - If you're still facing issues, consider the following:
      - Check if there are any updates available for Android SDK or UI Automator.
      - Verify that your Android SDK installation is complete and up to date.
      - Ensure that your Java Development Kit (JDK) is also properly configured.
      Remember to replace `` with the actual path to the `swt.jar` file

  • @TRB202
    @TRB202 19 днів тому

    hi @ragav i'm getting PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host. , what should i do now ?

    • @RaghavPal
      @RaghavPal  18 днів тому

      Nazra
      The error message you're encountering indicates that the AVD's CPU architecture 'arm64' is not supported by the QEMU2 emulator on an x86_64 host.
      Try using a emulator with different CPU architecture (other than ARM)
      Let's break down the situation and explore possible solutions:
      1. Emulator Limitations:
      - ARM64 emulation on an x86_64 host is currently only possible up to API level 27 (Oreo)
      - Unfortunately, newer Android versions (such as Android 31) with ARM64 architecture cannot be directly emulated on an x86_64 host.
      2. Workarounds:
      - While running ARM64 apps on an x86_64 host is challenging, here are some workarounds you can consider:
      a. Use Older System Images:
      - Create an AVD using an older system image (e.g., Android 27 or earlier) that supports ARM64 emulation.
      - Keep in mind that using older system images may limit access to newer features and APIs.
      b. Include x86_64 Binaries:
      - If your app includes native libraries (e.g., C or C++), ensure that you have binaries for both ARM64 (arm64-v8a) and x86_64 architectures.
      - The APK's `lib` directory should contain folders for both `arm64-v8a` and `x86_64`.
      - If you don't have x86_64 binaries, consider obtaining or building them and including them in your APK¹.
      c. Run on Physical Devices:
      - If possible, test your app on physical devices with ARM64 CPUs. Physical devices provide accurate testing environments for specific architectures.
      d. CPU Host Flag:
      - When launching the emulator, consider adding the `-cpu host` flag to the `qemu-system-x86_64` command.
      - For example:
      ```
      qemu-system-x86_64 -m 4000 -vga virtio -accel hvf -usb -device usb -tablet -drive file=ubuntu.qcow2,if=virtio -cpu host
      ```
      - This flag allows the emulator to use the host's CPU capabilities, which might improve compatibility³.
      3. Future Considerations:
      - Keep an eye on updates to the Android Emulator and QEMU. Newer versions may improve ARM64 emulation support on x86_64 hosts.
      Remember that emulating ARM64 on an x86_64 host has limitations, so choose the best approach based on your specific requirements

  • @nekkantimahalaxmi1906
    @nekkantimahalaxmi1906 Місяць тому

    please upload remaining videos

    • @RaghavPal
      @RaghavPal  Місяць тому

      Sure Nekkanti, next video coming tomorrow.

  • @fathimanazra1279
    @fathimanazra1279 27 днів тому

    hi ragav , i'm facing a new issue for UpsideDownSand i don't have arm 64 , is it okay to fetch another virtual device which is contain arm64 ? ( for me showing Vannila Icecrem arm 64 )

    • @RaghavPal
      @RaghavPal  27 днів тому

      Yes Nazra, check OS of your system and accordingly create the Virtual Device. I used ARM as I was using Mac os with apple m2 chip

    • @fathimanazra1279
      @fathimanazra1279 24 дні тому

      @@RaghavPal I think its better to upload for windows as well I'm still stuck on that part got so panic error in cmd

    • @RaghavPal
      @RaghavPal  23 дні тому

      oh.. got that.. I believe i had mentioned it while recording..

    • @fathimanazra1279
      @fathimanazra1279 23 дні тому

      @@RaghavPal yes , you've mentioned but not in windows ? Can you add a new vdo in windows also . Please sir

    • @RaghavPal
      @RaghavPal  22 дні тому +1

      okay.. i will check

  • @user-kr5cm3er3h
    @user-kr5cm3er3h Місяць тому

    please when are you uploading the sixth and seventh videos

    • @RaghavPal
      @RaghavPal  Місяць тому

      Martins, 6th video is coming this Thursday and next very soon