There was a time when NetBeans 6.9.1 with the Android library used to run my projects in the Android emulator. Now, it will compile my projects, but it never “runs” them – I can’t even get it to start the emulator!
Things I have tried:
- Creating a new Android device and forcing NetBeans to use that device
- Restarting NetBeans
- Restarting my PC
- Cleaning before building
- Verbally and physically abusing my desktop
So I guess my questions are:
- Are there other things I can do to get NetBeans to launch my project, and
- If not (1), is there a way I can export the package and launch it from the command line using the tool directly?
I Don’t use NetBeans for my android development, so i don’t know if there is a way to launch you app to the emulator using netbeans. But I have launched apps to the emulator through shell scripts, so it certainly possible through the command line.
launching the emulator can be done using the ’emulator’ tool provided in the sdk, here is the documentation:
http://developer.android.com/guide/developing/tools/emulator.html
assuming that the apk has already been built, you just need to install the apk using the adb (you may need to uninstall an old version of the apk prior to this which can also be done using the adb). here is that documentation:
http://developer.android.com/guide/developing/tools/adb.html
From here you can ether open the apps on the device and launch your desired app. or you can use the shell command through the adb to launch the app. this should be helpful for that:
http://www.android.pk/blog/general/launch-app-through-adb-shell/
now as i said all of this can be accomplished through a shell script if you so desire, how ever this become more involved as you’ll need to set up a function to poll the emulator until it fully launches, as installs and uninstalls can’t occur until the system has fully booted. this link will help if your feeling ambitious and want to set this up as a script:
http://devmaze.wordpress.com/2011/12/12/starting-and-stopping-android-emulators/
hope that helps.