in the post
Making the Android emulator run faster
there is the answer:
Linux:
Install KVM: open GOOGLE, write "kvm installation "
Create AVD with "Intel atom x86" CPU/ABI
Run from command line: emulator -avd
avd_name -qemu -m 512 -enable-kvm
Or run from Eclipse: Run/Run
Configurations/Tab "Target" - > check Intel x86 AVD and in
"Additional Emulator Command Line Options" window add: -qemu -m 512
-enable-kvm (click Run)
I am using Ubuntu 16.04 (and Oracle VM virtual box and Genymotion - but do not know if it matters there), I probably sucessfully installed KVM. Although, I do not understand the next part:
Create AVD with "Intel atom x86" CPU/ABI
What program or command this is?
AVD means Android Virtual Device. They most likely mean the that you use the normal emulator in Android Studio.
Here's a link that describes the process
Basically you have several AVD images to pick from, and you have to pick one that has an x86 CPU as opposed to an ARM CPU in the ABI column.
Related
I am trying to use this tool GemDroid https://github.com/huz123/GemDroid_QEMU. I have downloaded the AOSP android-4.4.4_r2 and built it as well. According to the link above, an AVD has to be created using Android Studio, which I did but it give selective options to download a system image, say an Android 4.4.
My first question is how can I link the AVD to the AOSP I have
downloaded? I tried pointing the location of the SDK to the AOSP
location from Files>ProjectStructure in Android Studio but it says
"SDK does not contain any platforms".
Is there a different way whereI can create an AVD directly from the
directory of AOSP?
Or according to the step "start the emulator with
your android virtual device as usual" in the link above, how can I
start the emulator from AOSP with an AVD created using Android
Studio?
I am using Ubuntu 14.04. Please help, thanks!
You don't need the Android Studio for that - just go to your root directory and type in the command line:
emulator
If this doesn't work you probably had a problem in your build.(Build the AOSP)
This is how I run the build
source ./build/envsetup.sh
lunch aosp_shamu-userdebug
./prebuilts/android-emulator/linux-x86_64/emulator
-sysdir out/target/product/shamu/
-system out/target/product/shamu/system.img
-ramdisk out/target/product/shamu/ramdisk.img
-data out/target/product/shamu/userdata.img
-kernel prebuilts/qemu-kernel/arm64/kernel-qemu
-scale 0.7
-memory 2048
-partition-size 4096
-no-window
-verbose
Problem:
I'm using only command line tools. AVD just worked fine some time ago. Now with various configurations I get only "Starting emulator for AVD..." which simply closes without any error messages and leaving emulator.exe in Task Manager for eternity.
What I've tried:
Various devices, API's, RAM above and below 768, with/without Host
GPU etc;
Reinstall Java;
Reinstall Android SDK;
Run emulator from command line just launches emulator.exe without any errors;
Delete .android folder in User's folder;
Set ANDROID_SDK_HOME variable;
Run SDK Manager.exe/AVD Manager.exe with/without elevated Admin rights;
verbose key gives me the following log:
emulator:Found AVD name 'jkll'
emulator:Found AVD target architecture: arm
emulator:Auto-config: -engine classic (arm default)
emulator:Looking for emulator-arm to emulate 'arm' CPU
emulator:Probing program: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:return result: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Found target-specific 32-bit emulator binary: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Adding library search path: 'C:\Soft\Android\android-sdk\tools/lib'
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
Configuration I am working on:
Windows 10 x64
Android SDK Manager 25.1.1
Java JDK 8 Update 91
i5 CPU with 24GB of RAM
Any suggestions? TY.
I tried all the mentioned solutions. But strangely, I reduced my windows 10 laptop's resolution (from 3840 x 2160 to 1360 x 768) and it worked.
With your verbose I found you are using arm architecture devices.As you are using i5 processor,Windows10 x64 I would Suggest you to use x86 or x86-64 architecture for your devices for this you have to Install Intel x86 Emulator Accelerator (HAXM) from SDkManager.
Hope this helps let me know.
After changed the CPU of my computer and updated sdk, I encounter this problem too.
Now I temporarily solve the problem emulator-x86 I get an error about missing Qt5Core.dll, Qt5Widgets.dll and Qt5Gui.dl:
copy *.dll files in sdk\tools\lib\qt\lib to sdk\tools where the emulator-x86.exe in.
When I run an AVD from the Terminal on Ubuntu 14.04, the following command is working without problems:
my_name#host:~$ emulator -avd my_avd
But when I want to use tcpdump to capture the network-traffic, the emulator fails to start:
my_name#host:~$ emulator -avd my_avd -tcpdump ~/test.cap
qemu-system-i386: -tcpdump: invalid option
I have no problems running the emulator with tcpdump on Windows, but on Ubuntu and Debian it refuses to work. Might this be a Bug or am I missing something? The same problem occurrs when I want to use the option -timezone Europe/Berlin. In contrast, the option -dns-option 8.8.8.8 is working fine. The problem occurrs for every AVD.
Android SDK:
SDK Tools 25.1.1
Platform-Tools 23.1
Build-Tools 23.0.3
Android 6.0 SDK Platform Revision 3
Android 6.0 (Intel x86 Atom Image 32/64 Bit Revision 8 and ARM EABI v7a Image Revision 3)
Virtualization (KVM) is enabled on Intel Core 2 Duo. Oracle JDK 8 is installed.
The same behavior occurred on my Mac, the solution seems to be to add -engine classic to your command line call. So it reads:
my_name#host:~$ emulator -avd my_avd -tcpdump ~/test.cap -engine classic
Credits go to #Interix for posting this here
According to your emulator, -tcpdump is an invalid option. Check emulator -? or man emulator for the syntax. However, I'd be surprised if this would normally work at all - I haven't seen tcpdump integrated with anything as an argument by itself (though I'm sure it's not impossible).
Normally I'd expect to use tcpdump as a command by itself. Depending what tools you have installed, I'd run up the emulator, check what ports it's running, and run tcpdump against its port range separately if you're looking for incoming traffic. If it's outgoing, use tcpdump to trace the traffic to the destination you're going to use.
I have Intel HAXM installed on my machine along with Atom image. When I fire-up emulator in Android Studio, don't see anything that would tell me if Intel HAXM is being utilized or not.
According to the screenshots on Intel's website, in Starting Android Emulation window in Eclipse, it show a message, informing that Intel HAXM is being utilized.
If your emulator is running with HAXM, you'll see output like this in your run console in Android Studio, with the relevant line being the "HAX is working" bit:
Waiting for device.
/Users/sbarta/sdk/tools/emulator -avd x86-API10 -netspeed full -netdelay none
HAX is working and emulator runs in fast virt mode
Device connected: emulator-5554
Or, according to Intel's official Installation Instructions for IntelĀ® Hardware Accelerated Execution Manager:
To verify that Intel HAXM is running, open a Command Prompt window with administrator privileges (Run as Administrator) and execute the following command:
sc query intelhaxm
If Intel HAXM is working, the command will show a status message indicating that the state is: "4 RUNNING".
According to the Android Studio documentation you can run the following:
$ ./sdk/emulator/emulator -accel-check
And if you see the following you have it installed:
accel:
0
HAXM version 6.0.3 (3) is installed and usable.
accel
It's really easy. just open cmd and do what I did base on below image:
If you see the response like mine, it means that the Haxm is working.
If not running, make sure your processor is capable of running Intel HAXM. You must have VT and ND (aka nx no execute bit) ON in BIOS. (You can read out the nx bit from running bcdedit as admin). But you can't have certain other VT items running (including Hyper-V or VirtualBox).
There's an article on troubleshooting Intel HAXM at software.intel.com (search on HAXM).
Android Emulator can be run using qemu/kvm on a Linux box as following.
emulator -avd Nexus5 -qemu -m 2048 -enable-kvm
If I have kvm installed and working on my system and I choose Use Host GPU while creating an AVD when I run the emulator will it be already running with hardware acceleration support through kvm?
Secondly, how do I make sure if the avd is running under kvm or is being hardware accelerated?