Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload Android application in emulator without restarting emulator in Eclipse?

Is there a way to reload an Android application in the emulator without closing the emulator, saving any code changes, and running the emulator again? If I make even a simple change to the layout, it takes about 30 seconds by time I run it in Eclipse and Android "boots", and I can unlock the emulator to run the application. Is there any way to shorten this time when making changes, or is it something I just have to deal with?

like image 458
Tai Squared Avatar asked Apr 08 '09 00:04

Tai Squared


People also ask

How do you refresh an app on an emulator?

For Android emulator press "CTRL + M" with keyboard on emulator for reloading the react native project.

How do I fix Android Emulator not working?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.


2 Answers

The Android emulator is hot-deployable. Once you save and click 'run' (assuming no compile errors) it will package and re-deploy to the emulator which will then restart the app to run the new version. The same is true if you have an Android Developer Phone connected via USB.

If you get the message "Warning: Activity not started, its current task has been brought to the front", it helps to quit/move from the front the running app in the emulator by pressing the back button. Seems like Android does not overwrite the running app in this case.

like image 125
Kevin Williams Avatar answered Sep 30 '22 14:09

Kevin Williams


In Eclipse go to Run -> Run Configuration ...

For the very first time you need to set the following highlighted option because you don't have any emulator already launched. enter image description here

After the first run now you have an emulator already running. Now when you make a change again go to Run -> Run Configuration ...

and Set the following highlighted option: enter image description here

Now the already running emulator will be used every time to relaunch your application and it takes a way less time.

Note: Every time before clicking the Run button press the back button in your emulator once. So, your application is no more running on emulator. Otherwise you might see the following warning:

Warning: Activity not started, its current task has been brought to the front

like image 20
Adil Malik Avatar answered Sep 30 '22 14:09

Adil Malik