why opening more than one Emulator while running? - android-emulator

While doing programs I normally use AVD Manager to open the emulator, but nowadays while I am running a program a new emulator is being opened automatically, it also takes a long time almost 10-15 minutes. Can somebody please help to avoid this problem?

If ou press run in eclipse and it cannot see a connected device, sometimes devices/emulators fail to connect to the adb daemon so even if they are open they are not connected it will automatically launch an android emulator to fulfil the request which will be the default emulator in the AVD list. The reason it is slow is because you are using an arm image and that emulator is just really really slow, what you will want to do is set up an AVD to use an x86 image, you might need to download this through the android sdk manager first if you haven't already and then follow the information at: http://developer.android.com/tools/devices/emulator.html to get it set up to work as fast as possible (HAXM, graphics acceleration etc)

Related

Android Studio: The emulator keeps crashing after sometime

Every time I run the emulator it runs normally at the beginning but after a couple of minutes it crashes and it's giving me this error:
emulator process finished with exit code 1073740791 (0xC0000409)
I am using windows 10 home edition. virtualization is enabled in bios. I don't have any other virtualization software installed (like virtual box).
any idea why this is happening?
It seems a buggy graphic card driver can cause a similar problem. I am not sure if this is generated your problem here or not, but it is worth to say; If you have an NVIDIA graphic card with the driver version of 378.49 (there may be other versions too!), you may experience this error due to some incompatibility with java.
Please update your graphic card driver or rollback it to version an older stable version and try again!. And read here for more information.
I might have an Idea what your problem is:
Restart the adb Server, you can do so by using the command Prompt in the following way:
First go to C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools with the cd command.
Then just type adb kill-server, and adb start-server, so like this;
cd C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools
adb kill-server
adb start-server
If that doesent work try to wipe and cold boot described in this question.
Try this :
Go to Tools ==> SDK Menager ==>Android SDK
(Appearance&Behavior=>System settings=>Android SDK)==>SDK Tools==>Intel x86 Emulator Accelerator(install this).
It will solve your problem.I hope it helps.
Here are a few things you can try:
Go to AVD manager and open settings for your virtual device. In the Emulated Performance section for graphics, change it from automatic to software.
Have a look at here. There could be an incompatability with other software incompatibility with other software such as Docker, Oracle Virtual Box and other products that use VCPU.
You could try a complete reinstall of Android Studio and make sure all updates are completed. There could be a bug in an older version of the emulator you are using that's fixed in a more recent release.
Edit
A couple more things you could try:
Open Android Virtual Device Manager, then click on options for virtual device, then wipe data, then cold boot.
Go to C:/users/(username)/AppData/Local/Android/Sdk/platform-tools in a terminal, then type adb kill-server, then adb start-server.
Edit
You could also try checking for memory leaks https://developer.android.com/studio/profile/memory-profiler and you could try increase the amount of RAM available for the emulator.
Go to Tools->Android->AVD Manager, then edit your AVD, then in the pop-up window click Show Advanced Settings, then finally increase the amount of RAM.
Edit
IT could be an issue with libGL or libstdc++. See here
It sounds like the emulator may have not installed correctly. Check these steps:
Ensure that you have installed Hyper-V . Documentation for running emulator on AMD
Then try this step to force a cold boot:
Android Studio Emulator and "Process finished with exit code -1073741511 (0xC0000139)"
If Its crashes again, then create a new emulator. You might also try and download a new image just to make sure that the one you installed is not corrupt.
You said you're using Windows 10? Error code 0xC0000409 is caused by a stack buffer overflow. It seems to have popped up a couple places all related by windows systems (might be totally irrespective of the android emulator). If this is the case I found a couple threads that might help solve your problem.
http://www.cplusplus.com/forum/windows/39061/
https://answers.microsoft.com/en-us/windows/forum/all/werfaultexe-the-exception-unknown-software/627da5c0-004a-e011-8dfc-68b599b31bf5?auth=1
http://windowsbulletin.com/solved-exception-code-0xc0000409-error/
https://www.tenforums.com/tutorials/16397-repair-install-windows-10-place-upgrade.html

emulator broken: This adb server's $ADB_VENDOR_KEYS is not set

Well a windows 10 update broke sleep, the computer went to sleep with the emulator open and now that's broken. When I run an app to launch in the emulator it will boot the emulator but won't install just time out. When I try and run an app into a running emulator instance Studio says:
com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK
I've followed some of the other threads here. I've tried changing
the environmental variable in control panel, but in fact I think it
pointed to the right place originally, where the sdks are these
days.
I've tried restarting the PC. I did try deleting a couple of
adb files, that didn't work.
I've tried deleting all the sdks and
downloading them again.
I've tried uninstalling and updating Android
Studio, several times. Now on AS 3.1, still not working.
Bit of a nightmare really.
How do I set the vendor keys? Using AS console commands? Can anyone point me to a dummies guide, this is a bit of a tangent for me, wish I could fix it from the GUI.
The working fix for this particular issue is to enable Developer options on your emulator and enable "USB Debugging".
OK so eventually downloading a nexus 4 x86 image android 27, with no play store worked. Sorry if this is repetition. Long live working emulators
Combining answers from here and there gives an answer that also worked for me in IntelliJ IDEA. I assume the issue is the same, since the emulator and AVD is the same.
Option 1:
Restart the emulator from AVD
Option 2:
Wipe the emulator data
Option 3: Stop the emulator. Then make sure it is up to date and try again.
If it still does not work, restart the adb server and retry.
adb kill-server && adb start-server
If it still does not work, perhaps your adb is out of date... somehow. This was the case for me. Running the following fixed that for me.
adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
emulator-5554 device
If it is now working for some emulators but not newly created ones, take note of the message in the emulator selection box: "Press Ok in the Allow USB Debugging Dialog"
Sadly, there is no such dialog. So go and enable Developer Mode in the settings of your emulated OS by tapping the Build Number several times. Then go to the Developer Settings and enable USB debugging.
After recent upgrades of emulator, the virtual device*) stays unauthorized. When I cold boot the emulator, sometimes I see the expected confirmation dialog, but this dialog goes away immediately, leaving no chance to click 'OK'.
We're aware of this problem and plan to fix it soon.
* Here, I was running x86 with API 28 and Google Play on Windows 10. I don't know which other scenarios are effected.
For anyone who might encounter this in the future -- I mean the ultimate issue of receiving the error, "This adb server's $ADB_VENDOR_KEYS is not set" despite not having any (or any sufficient) opportunity to click OK...
Resolution: In the Developer Settings, select the option to, "Remove existing authorized adb keys on device." Repeat the previous action -- the prompt will once again appear, as if the very first time.
-Mike
Go to developer options in your device and click on 'Revoke USB debugging authorizations'. Disconnect and reconnect your device. You'll get a prompt on your device to authorize your computer to connect to your device. click on 'OK' and your set.
Basically, the authorization key has gone out of date or it's no longer present. So, we just have to set a new autorization key and revoke the old ones.

Eclipse program not working

Hello I'm creating an Android project using Eclipse the emulator is very slow I tried using the emulator through my phone but it still wont work I have a Kyocera Event and android 4.0
software anyone have any suggestions on how to fix this problem so I can run the emulator through my phone?
Try to use HAXM if you have an Intel processor and a different image of the system rather than ARM. I had similar problem with debugging using my tablet, I would highly recommend HAXM.
Did you enable USB Debugging in your phone settings? And check SDK Manager - Extra - Google USB Driver
I have been using real devices to test my apps, and if you dont know, your device might not be recognized by your IDE even though it is picked up by your computer. The solution, first, click http://developer.android.com/tools/extras/oem-usb.html
scroll down to the bottom, locate the manufaturer of your phone and download the appropriate driver for your device, install it, then, you need to open the "SDK Manager" to download the system images for the platforms you want to test against, you might need to download the "Google USB Driver" in the "Extras" section in "SDK Manager". Or if you want an emulator that is as fast as a real device, consider "Geny Motion", pretty easy to install. You can search for "Geny Motion" through google, shoule be able to see it the first result. Hope this helps.

Cannot starting android emulator

I am studying about phonegap. I run Android Virtual Device Manager, selected a device and click started. After starting android emulator finished loading.
I saw emulator-arm.exe in the task manager and it took some memory resource. But no emulator appeared. After about 10 seconds, emulator-arm.exe disappeared from task manager.
I couldn't start Android Emulator. Please help me! Thank you!
Did you use the latest version of the platform-tools and the image? Run "android" script in your android-sdk/tools folder, and update all items related with emulators. Then, run "AVD Manager" in the root folder of the SDK. Then, create a virtual machine based on a real device of your choice. Then, run and wait, emulator takes some time to appear.
Other better choice would be use Genymotion emulator, which has more speed and stability. Good luck!

Running Instagram on AVD

I wanted to use Instagram on my computer, so I decided to use an Android Virtual Device for that task.
I downloaded the Android SDK and the newest apk for instagram for my computer.
Then I created a new AVD and ran it. After it was booted, I installed the instagram apk using adb install instagram.apk.
It installed smoothly and after clicking the app, it started.
Now here's my problem: From there on nothing works.
When I try to login and I press the login button, nothing happens like there would be no internet connection.
Browsers and other apps using an internet connection work just fine, just instagram doesn't work.
How can I fix this?
I think it has something to do that the android Emulator can't really handle a global proxy.
Therefore hostnames get resolved directly to their IP which violates HTTP 1.1 standarts and the request doesn't get send properly.
To fix this, it is needed to change it so the hostname gets send instead of the IP.
You should try creating an AVD with different settings. More RAM and allowing GPU emulation is a good idea. If you insist on using an AVD and you have an appropriate intel CPU then you can make the emulator run much faster by following these steps. They are a bit complicated, but worth it if you want the emulator to run quicker.
I typically try to avoid using the Android emulator while I am developing apps. It has its uses, but it tends to be slow and doesn't have all of the capabilities of actual devices.
As an alternative to using an AVD, I would recommend downloading and installing BlueStacks. BluesStacks was written from the ground up to allow running Android apps on your Windows PC or Mac. I have used it before and it does a great job. Much better than an AVD.
Try visual studio emulator for android. Instagram works on it with enabled and connected wifi. This emulator works better than BlueStacks.