Тёмный

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

Automation Step by Step
Подписаться 531 тыс.
Просмотров 7 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 55   
@PrajwalJorapur
@PrajwalJorapur Месяц назад
Not Getting Emulator Folder after running this command sdkmanager.bat "system-images;android-33;google_apis;x86_64". Only system images folder i found , but not emulator
@RaghavPal
@RaghavPal Месяц назад
Prajwal The sdkmanager command you're using is correct, but it only downloads the system images, not the emulator itself. To download the emulator, you need to use a different command. Here's what you can do: 1. Open a command prompt or terminal and navigate to the Android SDK directory (usually C:\Users\YourUsername\AppData\Local\Android\Sdk on Windows or ~/Library/Android/sdk on macOS/Linux) 2. Run the following command to list all available packages: sdkmanager --list This will display a list of all available packages, including the emulator packages 3. Find the emulator package you want to download, for example, emulator-android-33-x86_64. Note down the package name 4. Run the following command to download the emulator package: sdkmanager "emulator-android-33-x86_64" Replace emulator-android-33-x86_64 with the package name you noted down in step 3 5. Once the download is complete, you should see the emulator folder created in the Android SDK directory Alternatively, you can use the Android Studio's SDK Manager GUI to download the emulator. Here's how: 1. Open Android Studio and navigate to File > Settings (or Preferences on macOS) > Appearance & Behavior > System Settings > Android SDK 2. In the SDK Manager, click on the SDK Update Sites tab and make sure the Google Repository is enabled 3. Click on the SDK Tools tab and select the emulator package you want to download (e.g., Android Emulator) 4. Click Apply and then OK to download the emulator. After downloading the emulator, you should be able to find the emulator folder in the Android SDK directory -
@WaiMonMonPhue
@WaiMonMonPhue Месяц назад
Thanks for sharing. Regarding create avd, I am not getting emulator folder when installing sdkmanager "system-images;android-33;google_apis;x86_64". I am getting "system images" folder instead of emulator. Although I rename as emulator and try to create avd, get emulator must be installed error. Another try I download emulator manually and used cmd to create avd, getting "path is not valid system image paths are: null" error message. Hope you see this comment and reply to fix my problem. Thanks
@RaghavPal
@RaghavPal Месяц назад
Wai To create an AVD (Android Virtual Device) for mobile testing using Appium, you need to follow these steps: Step 1: Install the necessary packages First, you need to install the necessary packages using the SDK manager. You can do this by running the following command: sdkmanager "system-images;android-33;google_apis;x86_64" This command will download and install the system image for Android 33 with Google APIs for the x86_64 architecture. Step 2: Create the AVD After installing the system image, you can create the AVD using the following command: avdmanager create avd -n android33 -k "system-images;android-33;google_apis;x86_64" This command will create a new AVD named "android33" using the system image you installed in the previous step. Step 3: Verify the AVD creation To verify that the AVD was created successfully, you can run the following command: avdmanager list avd This command will list all the available AVDs on your system, including the one you just created. Troubleshooting If you encounter any issues during the AVD creation process, you can try the following: Make sure you have the necessary permissions to create AVDs on your system. Check that the system image is installed correctly by running sdkmanager --list and verifying that the system image is listed. If you are using a manual download of the emulator, make sure you have downloaded the correct version and that it is installed correctly. Regarding the error messages you mentioned: "emulator must be installed error": This error message indicates that the emulator is not installed on your system. You can try installing the emulator using the SDK manager or by downloading it manually. "path is not valid system image paths are: null": This error message indicates that the system image path is not valid. You can try verifying that the system image is installed correctly and that the path is correct I hope this helps
@JSeydl1788
@JSeydl1788 3 месяца назад
Hi, I'm having an issue in my command prompt hoping you can help me. I attached the message. I am particularly concerned about the PANIC message. C:\android\cmdline-tools\lastest\bin>emulator -avd myAVD_2 INFO | Storing crashdata in: C:\Users\12017\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.15.db, detection is enabled for process: 29596 INFO | Android emulator version 34.2.15.0 (build_id 11906825) (CL:N/A) INFO | Found systemPath C:\SDKTools\system-images\android-VanillaIceCream\google_apis_ps16k\arm64-v8a\ PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host. Thanks in advance for your help, and for your videos. They are great!
@RaghavPal
@RaghavPal 3 месяца назад
Joe The error message indicates that the AVD (Android Virtual Device) you're trying to run has an 'arm64' CPU architecture, but it's not supported by the QEMU2 emulator on an x86_64 host. Here are some insights and potential solutions: 1. Emulator Limitations: - ARM64 emulation on an x86_64 host is currently only possible up to API level 27 (Oreo). - If your AVD is using a higher API level (e.g., Android 33), it won't work on an x86_64 host due to the architecture mismatch 2. Possible Solutions: - Use a Hardware Device: - Consider using a physical ARM64 device (if available) for testing. Hardware devices provide more reliable results and support the latest APIs. - Install Android SDK Directly from Android Studio: - Uninstall any existing Android SDK installations (e.g., via Homebrew). - Download and install Android Studio directly from the official homepage. - Set up your AVD using Android Studio, which should handle the correct system images and configurations 3. Note on Custom Emulators: - While custom emulators might be tempting, they won't necessarily solve the issue. The QEMU2 emulator has specific limitations and reasons for not supporting certain architectures on x86_64 hosts Remember that running an AVD with ARM64 architecture on an x86_64 host can be challenging due to these limitations. If possible, consider using a physical ARM64 device or adjusting your AVD configuration accordingly -
@WhiteCoralRaven
@WhiteCoralRaven 2 месяца назад
Halo ragav, my test is run succeasfuly, but it always get "Error @wdio/appium-service: appium exited before timeout (exit code: null), do you know how to fix this?
@RaghavPal
@RaghavPal 2 месяца назад
This can help: discuss.appium.io/t/error-wdio-appium-service-appium-exited-before-timeout/40704
@Intraday_Market_Trader
@Intraday_Market_Trader Месяц назад
I am getting error if I try to louch app from Appium inspector Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command ''E:\\Software Testing\\CMD Tools\\platform-tools\\adb.exe' -P 5037 -s emulator-5554 install 'E:\\Software Testing\\Automation Testing\\ClearQuote Inspections.apk'' exited with code 1'; Command output: adb: failed to install E:\Software Testing\Automation Testing\ClearQuote Inspections.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
@RaghavPal
@RaghavPal Месяц назад
So you're trying to launch an app using appium inspector but it's giving you an error, right? step 1: check the apk file first, make sure the apk file you're trying to install is compatible with your emulator or device. you can use some tools to check the architecture of the apk file. just google "check apk file architecture" and you'll find out how. step 2: check the emulator or device next, check the architecture of your emulator or device. open a terminal or command prompt and type adb shell getprop ro.product.cpu.abi. this will tell you the architecture of your device or emulator. step 3: make sure the apk file is compatible if the apk file isn't compatible with your device or emulator, you need to rebuild the apk file with the correct architecture or use a different apk file that works. step 4: try installing the apk file manually try installing the apk file manually using the adb install command. this will help you figure out if the problem is with appium inspector or the apk file itself. step 5: check appium inspector settings check your appium inspector settings to make sure you've got the right android sdk and platform-tools configured. also, make sure the adb executable is in your system's path. step 6: update your android sdk and platform-tools make sure your android sdk and platform-tools are up to date. you can update them using android studio or by downloading the latest versions from the official android website. step 7: try a different emulator or device if none of the above steps work, try using a different emulator or device to see if the problem is specific to the one you're using. that's it! follow these steps and you should be able to fix the error and launch your app using appium inspector. -
@ryoharyo01
@ryoharyo01 28 дней назад
Hi Raghav im facing issue "Failed to find package 'emulator-android-33-x86_64'" when creating avd. can you help me?
@RaghavPal
@RaghavPal 27 дней назад
The error "Failed to find package 'emulator-android-33-x86_64'" typically occurs when the Android Emulator package for API level 33 (Android 13) is not installed or not properly configured. Here are the steps to resolve this issue: Step 1: Check if the package is installed Open the Android Studio, go to Tools > SDK Manager, and then click on the SDK Tools tab. Step 2: Install the package In the SDK Tools tab, check if the Android Emulator package is installed. If not, select the checkbox next to it and click Apply to install. Step 3: Check for updates Make sure you have the latest version of the Android Emulator package installed. You can do this by clicking on the Update button next to the Android Emulator package. Step 4: Verify the package After installation, go back to the AVD Manager and try creating the AVD again. If you still face the issue, try restarting Android Studio -
@STD2580
@STD2580 4 месяца назад
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 4 месяца назад
The three remaining videos will come this week and I will start on iOS setup from next week
@tabitavadranam1808
@tabitavadranam1808 Месяц назад
sir iwas notgetting emulator folder sir could pls helpme to get it
@RaghavPal
@RaghavPal Месяц назад
Tabita I'd be happy to help you with that. Let's break down the steps to create an Android Virtual Device (AVD) and troubleshoot the issue of not seeing the emulator folder. Step 1: Check if you have Android Studio installed Make sure you have Android Studio installed on your computer. If you don't have it, download and install it from the official website: Step 2: Launch Android Studio Open Android Studio on your computer. Step 3: Check if you have the Android SDK installed In Android Studio, go to File > Settings (on Windows/Linux) or Android Studio > Preferences (on Mac). Then, navigate to Appearance & Behavior > System Settings > Android SDK. Check if you have the Android SDK installed and the path is correct. If not, download and install the Android SDK. Step 4: Create a new Android Virtual Device (AVD) In Android Studio, go to Tools > Android > AVD Manager. This will open the AVD Manager window. Click on Create Virtual Device. Select the device configuration you want to emulate (e.g., Nexus 5X) and click Next. Choose the system image you want to use (e.g., Android 11.0) and click Next. Fill in the details for your AVD, such as the name, and click Finish. Step 5: Check for the emulator folder After creating the AVD, go back to the AVD Manager window. You should see your newly created AVD listed. Click on the three dots at the end of the row and select Show on Disk. This should open the folder where your AVD is stored, which includes the emulator folder. Troubleshooting If you still don't see the emulator folder, try the following: * Check if you have sufficient disk space available. * Make sure you have the necessary permissions to create folders and files in the Android SDK directory. * Try restarting Android Studio or your computer. * If you're using a virtual machine or a cloud-based environment, ensure that the Android SDK and emulator are installed and configured correctly. -
@saichaitanyasai3836
@saichaitanyasai3836 Месяц назад
hi when i am creating the avd it is telling like install emulator
@RaghavPal
@RaghavPal Месяц назад
Sai 1. Check Android SDK Installation: - Ensure that the Android SDK is properly installed on your system. You can verify this by running the command `sdkmanager --list` in your terminal or command prompt. This will list all installed SDK packages. 2. Install the Emulator Package: - If the emulator package is not installed, you can install it using the following command: ```bash sdkmanager "emulator" ``` 3. Verify AVD Manager: - Open Android Studio and navigate to Tools > AVD Manager. Ensure that you have at least one AVD configured. If not, create a new AVD by following the prompts. 4. Set Up Environment Variables: - Make sure that the environment variables `ANDROID_HOME` and `PATH` are correctly set. They should point to the location of your Android SDK. For example: ```bash export ANDROID_HOME=/path/to/your/sdk export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH ``` 5. Start the Emulator Manually: - Try starting the emulator manually to ensure it works. Use the command: ```bash emulator -avd ``` - Replace `` with the name of your AVD. 6. Check Appium Configuration: - Ensure that your Appium configuration is correct. Your desired capabilities should include the correct `platformName`, `deviceName`, and `app` path. For example: ```json { "platformName": "Android", "deviceName": "emulator-5554", "app": "/path/to/your/app.apk", "automationName": "UiAutomator2" } ``` 7. Update Appium and Android Studio: - Make sure you are using the latest versions of Appium and Android Studio. Sometimes, compatibility issues can arise from using outdated versions. 8. Check for Errors in Logs: - If the problem persists, check the logs for any specific error messages. This can provide more insight into what might be going wrong. --
@nekkantimahalaxmi1906
@nekkantimahalaxmi1906 4 месяца назад
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 4 месяца назад
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 4 месяца назад
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 4 месяца назад
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
@techforyou6969
@techforyou6969 5 месяцев назад
Thankyou so much sir , great work
@RaghavPal
@RaghavPal 5 месяцев назад
Most welcome
@MARTINSOLUDAYO
@MARTINSOLUDAYO 4 месяца назад
please when are you uploading the sixth and seventh videos
@RaghavPal
@RaghavPal 4 месяца назад
Martins, 6th video is coming this Thursday and next very soon
@ahmedezzat5883
@ahmedezzat5883 3 месяца назад
many thanks for this playlist and for your work , i am facing an issue when I start running the code (org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. ) Host info: host
@RaghavPal
@RaghavPal 3 месяца назад
Ahmed The `org.openqa.selenium.SessionNotCreatedException` occurs when a new session cannot be created. Here are some possible solutions: 1. Restart Appium Server: If the previous session wasn't shut down properly, this issue can occur. Try restarting the Appium server, and it should resolve the problem 2. Update ChromeDriver: Delete the old ChromeDriver (version 96) from the cache (usually located at `/usr/local/bin/chromedriver`). Let Selenium download the latest driver programmatically, which should solve the issue 3. Browser and Driver Compatibility: - Uninstall your existing browser and reinstall a version that matches the driver. For Google Chrome, you can download a compatible version [here](chrome.ywswge.cn/). - Ensure that your browser driver (e.g., ChromeDriver) matches the browser version. Download the corresponding driver version [here](chromedriver.chromium.org/downloads) and replace your existing driver Remember to check your specific environment and adjust accordingly --
@NadiaHashemi-cv4xx
@NadiaHashemi-cv4xx 3 месяца назад
The videos are great and useful, is there any way that you can help us with the setup directly. I think I just stuck in one part and giving a hard time
@RaghavPal
@RaghavPal 3 месяца назад
Nadia In these lectures, I have tried to guide step by step from scratch.. let me know what specific step you are facing issue with and what is the issue
@NadiaHashemi-cv4xx
@NadiaHashemi-cv4xx 3 месяца назад
@@RaghavPal I have problem in this section when I try to use sdkmanager --list which is the : Step 4 : Download platform-tools and build-tools for the specific Android OS Version that we need for our app testing Can download from Android Studio downloads page OR Run command: sdkmanager --list We can install packages in a single command, e.g. sdkmanager "platform-tools" "build-tools;33.0.0" Or we can install packages using separate commands, e.g. sdkmanager "platforms-tools" sdkmanager "build-tools;33.0.0" These whole doesn't work and everytime I try it says command not found. Not sure what I'm doing wrong. I already used the second option to use the android studio for the running emulator.
@RaghavPal
@RaghavPal 3 месяца назад
Nadia First, ensure that you have the Android SDK installed and that the necessary command-line tools are available. Here are a few steps you can follow: 1. Install Android Studio Command-line Tools (cmdline-tools): - If you're using Android Studio, open it and go to File > Settings > Appearance & Behavior > System Settings > Android SDK. - Check the "Show Obsolete packages" option. - Look for the "Android SDK Command-line Tools" and make sure it's installed. If not, install it. - Apply the changes and restart Android Studio 2. Alternative Method (Without Android Studio): - Open a terminal or command prompt. - Check if there are any packages to be updated by running: ``` sdkmanager --list ``` - If there are updates, run the following commands (make sure you have a good internet connection): ``` sdkmanager --update sdkmanager --install "cmdline-tools;latest" ``` - Finally, run: ``` flutter doctor --android-licenses ``` This should resolve the issue¹. 3. Environment Variables: - Ensure that your environment variables (like `ANDROID_HOME` and `PATH`) are properly configured. These variables should point to the correct Android SDK location. Give these steps a try -
@reviewkiemtiencucde825
@reviewkiemtiencucde825 5 месяцев назад
the video very beautiful, very well, thank you for sharing
@RaghavPal
@RaghavPal 4 месяца назад
Most welcome
@mantest99
@mantest99 Месяц назад
39:22 nitip jejak
@RaghavPal
@RaghavPal Месяц назад
did not get this
@mantest99
@mantest99 Месяц назад
@@RaghavPal thank you for your tutorials sir. could I get the another case study for mobile testing with katalon in your channel? I'm still newbie
@RaghavPal
@RaghavPal Месяц назад
Can check more videos here - automationstepbystep.com/ There is also a course on Mobile Testing on Katalon Academy - academy.katalon.com/courses/?ka-cat=98
@fathimanazra1279
@fathimanazra1279 4 месяца назад
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 4 месяца назад
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 4 месяца назад
@@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 4 месяца назад
oh.. got that.. I believe i had mentioned it while recording..
@fathimanazra1279
@fathimanazra1279 4 месяца назад
@@RaghavPal yes , you've mentioned but not in windows ? Can you add a new vdo in windows also . Please sir
@RaghavPal
@RaghavPal 4 месяца назад
okay.. i will check
@nekkantimahalaxmi1906
@nekkantimahalaxmi1906 4 месяца назад
please upload remaining videos
@RaghavPal
@RaghavPal 4 месяца назад
Sure Nekkanti, next video coming tomorrow.
@sajithdilshan2936
@sajithdilshan2936 5 месяцев назад
super !!
@RaghavPal
@RaghavPal 5 месяцев назад
Thanks
Далее
Провал со стеклянным хлебом…
00:41
БАГ ЕЩЕ РАБОТАЕТ?
00:26
Просмотров 96 тыс.
I Took An iPhone 16 From A POSTER! 😱📱 #shorts
00:18
Gatling Step by Step Masterclass | Part 2
56:14
Просмотров 1,7 тыс.
Setup appium for iOS Real Device and Simulator
17:20
Просмотров 20 тыс.
Провал со стеклянным хлебом…
00:41