Need to start new emulator every time while debugging Android app - android

Unlike iPhone/iPad Emulator, Android Emulator doesn't remain active in AVD.
Once (for first time only) I run the app on emulator, it works, quiet slow though.
I go back in the code, do some changes and try to test new code on emulator, but for second time, the existing emulator doesn't show up in the AVD Manager list. Yes, after last debug, I came back to home screen, retried to Run, AVD Manager pop up and shows me only my android phone connected but not the emulator.
I tried this(Eclipse not running Android app on emulator a second time) answer already but it doesn't solve my problem.

Related

Android emulator not releasing the lock

I am facing a problem when working with Android emulators, and more specifically, when working with Selendroid.
When I start Android emulator through ./android avd (selecting an AVD and clicking into start), several lock files are created into ~/.android/avd/ so that another instance of the emulator cannot be executed. When I close the emulator, clicking the cross at the top right side, those files are automatically removed.
However, if I kill the emulator by connecting through telnet and calling "kill" command, those files are not removed. As this is what Selendroid does to close the emulator, the result is Selendroid is not detecting the emulator was closed and it is facing an infinite loop.
The weird thing is Selendroid itself logs the following message: "emulator still running, sleeping 0.5, waiting for it to release the lock", so I am discarding Selendroid creators having forgotten this.
Could there be any other reason for those lock files not being removed? Help is much appreciated!
I made some changes to Selendroid so that lock files are removed when emulator is detected to be closed.
https://github.com/selendroid/selendroid/pull/877
This worked for me:
Go to AVD Manager and click on the down-arrow on the right to emulator row and click Stop. This stops the emulator and you can start it again.

Emulator doesn't feel like emulating if I ignore it

I'm curious if anyone else is experiencing this problem or if it's just me. If I don't upload to the emulator for a few hours it seems to lose all interest in participating in today's activities until I close it and relaunch it. Android Studio shows it running in the Choose Device dialog when I hit Run, it's state is Online but when I hit ok it never launches in the emulator. I even get the "Session 'app': running" popup in the bottom corner of AS. When I close the emulator I get "Error accepting connection, aborting" in the Run panel. If I run again and launch a new device everything will be fine and I can upload as much as I want until I leave it for an undetermined amount of time.
Is there a fix for this? It's not a huge deal to restart the emulator, it's just kind of annoying.
you can directly use your android smart phone to run your application. There is no need to launch any emulator. its faster too. Just make sure that while attaching your smart phone to your Laptop/Desktop, you need to have phone driver in your Laptop/Desktop.

How to stop an Android emulator from Eclipse or Emulator button?

I just wonder how do I stop or exit Android emulator if I want to modify the source code and run again?
Do I just click on the emulator the "Power" button?
Restarting the emulator is the equivalent of rebooting a phone everytime you test something.
It takes a lot of time and it's completely unnecessary (unless you're testing something that happens during reboot). Just re-run the code, Eclipse and adb will do the rest. Keep the window of the emulator open all the time, it will just re-install the apk onto it.

Android Emulator boot

I'm starting android development from just three days, I have downloaded the SDK and install the platform and define the emulator, but it takes a lot of time to boot every time I run the application
Is there a way to run the emulator once and then run the application and to be updated on the emulator without closing it and re-opening it again
I'm using eclipse classic please any one try to help
Yes, just hit "Run" again, it will be reinstalled automatically if you changed code, otherwise you will see a message like "brought to front".
I recommend to not stop the emulator as long as you don't have to.
You don't need to close your emulator every time. Assuming you are using eclipse--> Right click on project-->Run-->Android application, if any changes, those will be deployed. Otherwise same screen will showup.
Yes. I usually just leave it open and launching the program from Eclipse updates the program in the emulator and launches it.
One weird thing is that the first time I launch it I get an error from Eclipse telling me that it has not been able to connect to the emulator, and the next time I launch the application a new emulator is launched. Usually I just close the first emulator, launch it again and then it works as it should.

Installing the same app on two emulators

When I launch the android emulator through eclipse for the first time, its menu shows all the test apps that I have created. But when the launch a second instance of the same emulator, its menu does not shows any of my apps. How can I install my apps on the second emulator as well? I need to have an application installed on both the emulators to test it.
It happens because you can't run two emulators simultaneously. In fact you can but second emulator will not use emulator image files - second emulator will not use previously saved data and will not save any changes. Two emulators can't use one emulator image file simultaneously. You can read about emulator image files here.
Solutions:
You can install your application on second emulator after launching through Eclipse or adb.
Or you can create another "emulator" (AVD file). How to do it.
In eclipse you can run the app in the desired emulator. Just click the run button and choose the emulator you want to have it to run in. The apps are in the other emulator because you used that emulator apperently all the time. When you wipe user data at launch of the emulator all the apps are gone.
So just run it in the other emulator and it will be available from the menu.

Categories

Resources