Starting an android emulator - android

I'm running OSX 10.10.3
I'm trying to make an AVD but am having issues.
I followed these instructions http://developer.android.com/tools/devices/managing-avds-cmdline.html and http://cordova.apache.org/docs/en/5.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide
I run
$ android create avd -n first -t 2 --abi default/x86
Android 5.1.1 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Error: Unable to find a 'userdata.img' file for ABI x86 to copy into the AVD folder.
Error: AVD not created.
I have many sdks and images installed but for whatever reason the avd creation tools can't locate them. How do I fix this?
Here's what my sdk manger looks like

It looks like your answer is in the screenshot: "This AVD may not work unless you install the Google APIs Intel Atom system image for API 22 first."
You say you have "many sdks and images installed" but please verify that you have that one in question installed.
Also, you can try creating the avd with the armeabi system image instead of the x86 one.
Also, the Google APIs have a different system image than the "plain" SDK targets.

Look your sdk manager image.
You must check:
Intel x86 Atom_64 system image.
Intel x86 Atom system image.
And create the AVD again.

I ended up deleting my sdk tools directory. Reinstalling the stand alone sdk-tools and android studio. Then the SDK manager redownloaded all the necessary images.

Related

How to run Android 2.3.3 Emulator with Android Studio v2?

The problem is that in the latest Android Studio, ARM system images for Android 2.3.3 (API 10) is no longer available for download from the SDK Manager. Instead there is an option called Google APIs, which downloads all files not in the Android\sdk\system-images folder, but in the Android\sdk\add-ons folder. Under that folder I'm indeed able to find system.img and other files, so in theory I should be good to go. But in practice, when I try to run created AVD for Android 2.3.3 I get this error message:
Cannot launch AVD in emulator.
Output:
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is undefined
When I set ANDROID_SDK_ROOT path variable it changes the error message to this:
Cannot launch AVD in emulator.
Output:
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is defined
(c:\Users\XXX\AppData\Local\Android\sdk) but cannot find kernel file
in c:\Users\XXX\AppData\Local\Android\sdk\system-images\ sub
directories
but still no result. It seems that it looking in the wrong directory. Please help. How can I get rid of that error and run that emulator? And what is the difference between system-images and add-ons folders in the android sdk? Why images from the first one I'm able to run without any trouble and the second one gets me an error?
Searched the web and stackoverflow for similar questions didn't find any correct answer.
Note: Do NOT suggest to download Intel x86 Atom Image - it's useless for me, because I have AMD processor. Do NOT suggest Genymotion, that is not the point of this question.
At first launch SDK manager using link in studio "Launch standalone sdk manager" below the list of sdk platforms, or manually from your sdk folder (path-to-sdk\sdk\SDK Manager.exe).
Make sure that you have installed SDK platform for Android 2.3.3;
ARM system image for Android 2.3.3 (API 10) is not accessible separately, because before Android 4.0, the ARM emulator image is distributed as a part of "SDK Platform" download.
To see other downloads for old platforms, check "Obsolete" checkbox in SDK manager.
As I know, image must appear in "...\sdk\platforms\android-10\" folder
I encountered the exact problem and it was solved by specifying the kernel file name as a separate parameter to the command line emulator tool, as given below.
emulator -avd Nexus_5_API_25_2_ARM -kernel C:\Users\XXX\AppData\Local\Android\Sdk\system-images\android-25\google_apis\arm64-v8a\kernel-qemu
Even though it complained that the emulator is out of date, the above command worked like a charm.
As alternative way you can try GenyMotion Emulator

Android Studio 2.0 Cannot launch AVD in emulator

I can successfully launch AVDs for the targets Android 5.1 (Google APIs) and Android 6.0 (Google APIs), both using CPU=x86. However the AVD I create for Android 4.1 (Google APIs) using CPU=arm cannot be launched. When I try to launch it I see a dialog:
Cannot launch AVD in emulator.
Output:
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is undefined
Since two AVDs do work I'm sure ANDROID_SDK_ROOT is defined. I've also verified that File -> Project Structure -> SDK Location is correct.
I have also run the Android SDK Manager, uninstalled all API 16 items and reinstalled these API 16 items:
SDK Platform
Intel x86 Atom System Images
ARM EABI v7a System Image
Google APIs
Sources for Android SDK
Within the Android SDK Manager all other libraries and packages are up to date. And I have restarted my Windows 7 computer.
Also note that I am forced to create this API 16 AVD for CPU=arm rather than using CPU=x86 as the Android Virtual Device Manager, when showing available system images, does not show an x86 image for target=Android 4.1 with Google APIs).
Does anyone know what the problem is? Or suggest things I can try to debug this issue?
Edit from a day after opening this question: Since I've seen no answer I'm assuming this is another Android Studio bug. I've input this bug report - https://code.google.com/p/android/issues/detail?id=207494
I got same error while trying to run ARM based emulator which is of API 16. I got this error when ARM images are downloaded from the android-studio itself( Not using Standalone SDK Manager option under System Settings->Android SDK in android-studio).
I solved this by launching Standalone SDK Manager from android studio. Then open Tools->Manage AVDs from Standalone SDK Manager menu. Here you can find your emulators. I observed that my ARM CPU emulator shows question marks in the columns named Platform,API label,CPU/ABI. Which seems to be some sort bug. Select the Emulator and click on edit. Choose the Target API,CPU/ABI properly and then click ok.
Now my emulator works perfectly. This solved my problem.
I figured out that updating android-studio caused this problem for me.

Unable to create AVD

I download new android developer tools , create new project but I cannot not create android virtual device.
But like image show I have only one target (Android 4.4 w) and when I choose it, I not have CPU (no system images installed for this target)
When I making application for target I set android 4.1.
Please help me.
Thanx
There are various things which can cause this:
You have not installed the system image. Open your SDK manager and ensure that you've installed ARM EABI v7a System Image under the Android 4.2 section.
You need to restart Eclipse (or try it directly via the AVD tool)
You have spaces in your device name which can break the functionality
THe Eclipse Plugin is not up to date (if you start the AVD manager via Eclipse
In most cases it is System image which is missing. Give it a try.
Steps:
1: Eclipse > Window > Android SDK Manager > Android 4.4W(API 20)
2: There select, ARM EABI v7a System Image and Android Wear Intel x86 Atom System Image
3: Scroll down to Extras , and select Intel x86 Emmulator Accelator( HAXM Installer). This helps in speeding your emulator.
4. Click Install 3 packages in bottom-right.
5. Restart AVD with target = Android 4.4w, CPU/ABI = Intel x86 and check Use Host GPU(at bottom of AVD)

Empty data directory in Android virtual devices

I downloaded the Android SDK and installed it at C:\AndroidSDK on Windows 8. After installing several APIs, tools and extras with the Android SDK Manager, I created two AVDs of the 4.0" WVGA, one using ARM (armeabi-v7a) and one using Intel Atom (x86). Both used API level 15. I started both from the AVD Manager but they both had black screens with "Android" in the middle. A splash screen was never displayed and when I looked at the emulators with adb shell and eclipse DDMS, the data directories were empty.
What can I do to fix this problem?
[NOTE: I had previously tried to install an apk file on an emulator but received an error that data/local/tmp was not found. I then completely uninstalled the Android SDK, deleted C:\Users\Steve\.android and did the above.]

Installing a x86 image in new sdk tools v12

I've upgraded to android sdk tools 12.
As a release note google says:
The AVD manager and emulator can now use system images compiled for ARM v7 and x86 CPUs.
Has anyone tried to run a x86 image? Are there any 3.0+ images?
Thanks,
In the GUI of the SDK for emulator configuration, the CPU type drop down box is disabled. Probably this is something they are preparing for the release 13 of the Android SDK tools. (it is also possible that non of my installed platform revision have x86 images)
I tried to run one of my emulator images as x86 explicitly, and get this:
C:\Program Files\Android-SDK\tools>emulator-x86.exe -avd HTC_Magic
qemu: linux kernel too old to load a ram disk C:\Program Files\Android-SDK/platf
orms\android-4\images\/kernel-qemu, C:\Program Files\Android-SDK/add-ons\addon_g
oogle_apis_google_inc_4\images\/ramdisk.img, qemu=1 console=ttyS0 android.qemud=
ttyS1 androidboot.hardware=goldfish clocksource=pit android.checkjni=1 ndns=2
I think the emulator image needs to be created explicitly for x86... Would be nice to have an x86 image so the performance of underlining qemu goes up, as it will not need to emulate ARM CPU instruction set...
You can already run http://www.android-x86.org/ and connect to it with adb over tcpip right now. You do not need the SDK support for it. And it is very fast.
Otherwise if you install the Google TV add on on linux you can create a Google TV avd and that will use x86. It really works nicely only on Linux though since that is where it is tunneled to the hypervisor properly.
There are various blog post around on how to set that up properly e.g. http://commonsware.com/blog/2011/09/01/google-tv-emulator-seemingly-pointless.html
You should install Intel® Atom™ Android x86 Emulator Image.
You could find detailed instructions at this link
You can build your own android x86 emulator from the AOSP. Here are the instructions from the Intel website:
http://software.intel.com/en-us/articles/android-ia-emulator-gingerbread/
http://software.intel.com/en-us/articles/android-virtual-device-emulation-for-ia/
updated article provides info about using 3.2 images, perhaps my sdk does not offer such choice (tested 2.3.3, 3.2 and 4.0.3)
more likely the article refers to an intel based sdk build, that is not the one provided by android developer site.
They may add intel images (yet it's true the emulator needs x86 based images) later and support also intel abi
After a few months passed, the source code for the android 4.0 was released and I find that the x86 virtual machines are faster than any solution I tried which used the Android Emulator.
You can find instructions on using android x86 images here: http://www.android-x86.org/
I followed the instructions here and was able to build a working x86 image. It runs great, much faster than ARM emulation, provided kvm is enabled, which you can by doing "sudo apt-get install kvm" on Ubuntu machines. To check if kvm is already on your machine, do an lsmod | grep kvm.
To answer the other question, Google hasn't released any images with it's SDK yet and this is the thread where someone from Google responded to my question about it.
They plan to release Gingerbread images pretty soon. Which is why there is no drop down option saying "Intel" or x86 in the CPU box of the Android tool (yet).

Categories

Resources