Android Studio AVD doesn't start - android

When i run a x86 emulator, it won't start. I tried run this command on terminal:
/home/username/Android/Sdk/tools/emulator -avd Nexus_5X_API_26 -netspeed full
and ı got this output: emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
arm emulators run but x86 emulators don't.
My os: Debian 9

First of all check your code for errors if everything ok
Second check that you have intel haxm installed and working
I hope that I have helped you

Related

Android Emulator ARM64 won't start "The emulator process for AVD Pixel_6_Pro_API_33_ARM64 has terminated." But x86_64 works fine

I am unable to start ARM64 emulator on my Windows 10 system but x86_64 works fine. Intel HAXM installed successfully, so of course virtualization is enabled
What can be the reason?
DualCore Intel Core i5-7300U
Update
Running an emulator from the console it prints the next error:
PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host
Update 2
It seems we can not use newer Android API for ARM64 emulator on x86_64 systems - https://stackoverflow.com/a/74819011/7767664

Android Studio not launching an emulator

When i am trying to run Android code in Android Studio it shows the following in the event log. But I'm not getting any output and am unable to open the emulator.
Executing tasks: [:app:assembleDebug, :app:assembleDebugAndroidTest]
7:28:43 PM Gradle build finished in 4s 386ms
7:30:24 PM Executing tasks: [:app:assembleDebug]
7:30:27 PM Gradle build finished in 3s 576ms
When I am trying to run from AVD Manager it shows as follows:
Cannot launch AVD in emulator.
Output:
emulator: WARNING: VM heap size set below hardware specified minimum of 384MB
emulator: WARNING: Setting VM heap size to 384MB
emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support.
Your CPU: 'AuthenticAMD'
When this type of problem happens, best way is to make sure you have followed below points correctly.
You have proper SDK installed
You have Intel HAXM & virtualization option enabled in your BIOS
Configure emulator correctly, download the Intel X86 Atom system image for better performance.
User arm instead of x86 if you have AMD processor when creating emulator.(In most of case)
When you created your device you should have used arm instead of x86. It must work
I'd recommend using Visual Studios Android Emulator
It is stand-alone, so you dont need Visual Studio to run it, it boots up in seconds, and is more robust then GenyMotions Android Emulator.
Launch your emulator from VS Android emulator, once the OS boots and the homescreen displays run your code and it will give you an option to choose the VS emulator in android studio.
Download latest version of Haxm and enable it in bios (hardware acceleration), on most computers it is basically turned off

Android SDK. Can't start AVD

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.

Android emulator fails to start when used with tcpdump-option

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.

How to find out if Android Studio is actually using the Intel HAXM accelerator?

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).

Categories

Resources