Sunday, January 27, 2013

Run Android App from Eclipse on AndroVM Virtual Device

In this post I will show how to run my hello world app called HelloGalaxy from Eclipse on my virtual Android device. (I described how to build, package and deploy the app in previous posts).

Fire up AndroVM and note the IP Address of the device as described in my previous post, where I described how to deploy your app to AndroVM .

Connect to your running VM on the command line.


cd ~/develop/adt-bundle-mac/sdk/platform-tools$

$ ./adb connect 192.168.56.101

To check that you are connected, simply execute:


$ ./adb devices
List of devices attached
192.168.56.101:5555 device



Now you can execute your app from Eclipse.  When you select Run-> Run As -> Android Application (as I described in Building HelloGalaxy post).  This will compile, build and package the HelloGalaxy.apk file and pop up a Android Device chooser dialog.



Select the AndroVM device and click OK (You can also check the :Use same device for future launches" to skip the dialog on the next run.

Check the log files in the eclipse console and you should see messages saying: "Uploading HelloGalaxy.apk...", Installing HelloGalaxy.apk...", "Success!", "Starting Activity...", etc.


Thats it.  You may need to bring the AndroVM to the foreground and you should see HelloGalaxy running on the device.

If you make any code changes, simply select Run from the Run menu and your app will be re-compiled, packaged, deployed and executed on the AndroVM.



No comments:

Post a Comment