Posts

Showing posts with the label Android Emulator

Android Studio Emulator Does Not Come With Play Store For API 23

Image
Answer : I've had to do this recently on the API 23 emulator, and followed this guide. It works for API 23 emulator, so you shouldn't have a problem. Note: All credit goes to the author of the linked blog post (pyoor). I'm just posting it here in case the link breaks for any reason. .... Download the GAPPS Package Next we need to pull down the appropriate Google Apps package that matches our Android AVD version. In this case we’ll be using the 'gapps-lp-20141109-signed.zip' package. You can download that file from BasketBuild here. [pyoor@localhost]$ md5sum gapps-lp-20141109-signed.zip 367ce76d6b7772c92810720b8b0c931e gapps-lp-20141109-signed.zip In order to install Google Play, we’ll need to push the following 4 APKs to our AVD (located in ./system/priv-app/): GmsCore.apk, GoogleServicesFramework.apk, GoogleLoginService.apk, Phonesky.apk [pyoor@localhost]$ unzip -j gapps-lp-20141109-signed.zip \ system/priv-app/GoogleServicesFramework/GoogleSer...

Android Emulator Error: "System UI Has Stopped"

Answer : This is still "unanswered", but it probably has been resolved. I just want to share my experience and clarify a few things, some of which may not matter. Anyway, if this helps someone else that's great. 1) I had this problem on one machine (a new, but slower machine), but not another (the faster one) when running a 4.0.3 emulator. It is not a hardware problem though, and CPU speed doesn't make a difference. 2) Both machines are fully up-to-date ADT (Eclipse 4.2.x and Android 4.2.2 (API 17) SDK environments. 3) Editing, or even Deleting the emulator and then recreating it did NOT fix it. 4) The best solution is to locate and update the config.ini file. In Windows 7 (x64) I found the config.ini file in C:\Users \ [your user name] \ .android\avd\ICS_4.0.3_API_15.avd [*see AVD names below]. NOTE: First make sure you have “show hidden files, folder, or drives” turned on in Explorer or you won't see the ".android" folder. 5) Not s...

Can't Install Android Emulator For AMD Processors

Answer : I found the answer after long time. I had to enable Virtualization on my machine. If you are using Avast antivirus (Or AVG), The problem may be in it. So things to do to fix this: -Activate Virtualization in bios -Deactivate Hyper-v and hypervisor platform in "activate/desactivate windows function" & run powershell as admin and make :"Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V" -In Avast Antivirus. In settings click Troubleshoot on the left side of the screen, uncheck the box next to Enable hardware assisted virtualization, then click OK to confirm and restart your computer I've got the solution from https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/issues/10#issuecomment-715423881 If You are using AMD Ryzen Just go to bios setting check for SVM Mode if it is Disabled then Enable it .. Emulator work perfectly..Below Link show where to enable SVM Mode in Aorus Gigabyte Motherboard BIO...

Android - How To Access Emulator Screenshot Via Emulator?

Image
Answer : It will save in your PC . You can also specify the location of screenshots from the emulator settings . Please see the following image for reference. Emulate Volume Down + Power event to trigger Android's screenshot, then screenshot pictures will be stored at emulator's /storage/emulated/0/Pictures/Screenshots . Here is the script. Run adb shell , then copy the code below and run, you should see the emulator start taking a screenshot. cat > /data/local/tmp/screenshot.sh <<EOF #!/bin/sh echo 'volume key: down' sendevent /dev/input/event1 1 114 1 echo 'power key: down' sendevent /dev/input/event1 1 116 1 sendevent /dev/input/event1 0 0 0 sleep 1 echo 'volume key: up' sendevent /dev/input/event1 1 114 0 echo 'power key: up' sendevent /dev/input/event1 1 116 0 sendevent /dev/input/event1 0 0 0 EOF sh /data/local/tmp/screenshot.sh NOTE: My emulator's input device is "/dev/input/event1", this may be differ...

ADB Root Is Not Working On Emulator (cannot Run As Root In Production Builds)

Answer : To enable root access: Pick an emulator system image that is NOT labelled "Google Play". (The label text and other UI details vary by Android Studio version.) Exception: As of 2020-10-08, the Release R "Android TV" system image will not run as root. Workaround: Use the Release Q (API level 29) Android TV system image instead. Test it: Launch the emulator, then run adb root . It should say restarting adbd as root or adbd is already running as root not adbd cannot run as root in production builds Alternate test: Run adb shell , and if the prompt ends with $ , run su . It should show a # prompt. Steps: To install and use an emulator image that can run as root: In Android Studio, use the menu command Tools > AVD Manager . Click the + Create Virtual Device... button. Select the virtual Hardware, and click Next . Select a System Image. Pick any image that does NOT say "(Google Play)" in the Target column. If you dep...

Android Emulator Camera Custom Image

Image
Answer : Under Tools > AVD Manager , select the "pencil" to get to "Virtual Device Configuration". Show Advanced Settings > Camera will give you the option of using emulated, or a device: Device - use host computer webcam or built-in camera If all you need is to get a still image into the camera, starting with Android Studio 3.2 you can put your static images into the virtual scene: as discussed in this entry from Android developers blog. Note that you'll need to move the camera position into the dining room to see your images (turn around and use Alt-w to move forward). Finally! Append to file ~/Android/Sdk/emulator/resources/Toren1BD.posters poster custom size 2 2 position 0 0 -1.8 rotation 0 0 0 default custom.png Place 'custom.png' in ~/Android/Sdk/emulator/resources/ Restart! emulator @Phone -no-snapshot -no-boot-anim (replace 'Phone' with the name of your avd! (see: emulator -list-avds) Profit! Now you have a...

Android Studio - Android Emulator Wifi Connected With No Internet

Image
Answer : Stated below are the solutions for Windows and Mac, but similar solutions will work on any OS: On Windows Open Network and Sharing Center and click on current Connection Click on Properties Double Click on Internet Protocol Version 4 (TCP/IPv4) Set the Preferred and Alternate DNS servers as (Screenshot below) : 8.8.8.8 8.8.4.4 On Mac Go to Settings > Network > Advanced... > DNS Delete whatever entries you have there and add these two entries (Screenshot below): 8.8.8.8 8.8.4.4 Note: For Mac users, if the entries field is disabled and you're not able to edit it, click on the 'Lock' icon in the bottom area of that window and enter the password to be able to make changes Restart the emulator, and it should solve: Screenshots: Windows Mac Edit: This is the fix for a situation when the emulator's wifi has changed the DNS to some non-working DNS. While this works most of the time, there might also be other rea...

Android Emulator - "Encryption Unsuccessful"

Image
Answer : Wiping data in Android Virtual Device Manager helped me in my case. Tools -> Android -> AVD Manager -> Actions (triangle down) -> Wipe Data There is also Advanced settings in virtual device's configuration ( the pencil ) where is a configuration of SD card and internal storage, but I didn't have to change it. Android Device Manager > Stop your device and right click > Factory Reset

Android Studio - Manually Download System Image For Emulator

Answer : In windows: First locate your android-sdk. By default it's in your C:\Users\Your.name\AppData\Local\ in it's root folder. where you can find: SDK Manager.exe, make a folder name it "system-images", my api 25 image is at system-images\android-25\google_apis\x86_64\Files Hope you can Figure it out. Comment if you have any problem. In mac OSX: ~/Library/Android/sdk/system-images/android-[API_VERSION]/[API_TYPE]/x86 Replace [API_VERSION] with Android version you are downloading and the [API_TYPE] can either be google_apis_playstore or google_apis depending on whether the image you are downloading comes with Google Play or not. On Windows 10: Download the file from e.g.: https://dl.google.com/android/repository/sys-img/google_apis/x86-27_r09.zip. Extract the zipped file. Copy (OR Cut, not recommended) the contents of the extracted folder e.g.: x86 . Find the android-sdk folder. By default, it should be located at C:\Users\[YOUR USER NA...

Android Automotive Emulator "no System Images Installed For This Target"

Answer : You are not on the Canary channel for Android Studio, so you are not receiving updates for the Automotive Image. Your Android Studio version is only receiving updates for stable releases of Android. This can be fixed by switching over to the Canary channel in the Android Studio Preferences or downloading the Canary version. Go to 'Android Studio >> Preferences >> Appearance & Behavior >> System Settings >> Updates'. From there you should a drop-down menu for "Automatically check updates for 'Stable Channel'". Go to the drop-down menu and switch over to 'Canary Channel'. Another solution is to download the Canary version of Android Studio listed here: https://developer.android.com/studio/archive. Look for the releases that are labelled 'Canary'. For Automotive OS (not Android Auto) you must add system image (at the moment only for Volvo Polestar 2 image) In Android Studio, select Tools > SDK Man...

Changing Locale In Android Emulator

Answer : I am using the emulator with Android 4.2 + 4.3 and there is an app to set the locale called "Custom Locale". Start emulator -> Launcher -> Custom Locale => Select the desired language from the list => Confirm with e.g "Select 'de_DE'" My solution is to use preinstalled on android emulator "Custom locale" application. Simply send intent with extra language parameter to it as below: adb shell am broadcast -a com.android.intent.action.SET_LOCALE --es com.android.intent.extra.LOCALE EN More information here - prepare android emulator for UI test automation. No Need to change local, just long press on the EditText widget, on the popup menu select input method, and change to the android keyboard.