tacos_tacos_tacos
tacos_tacos_tacos

Reputation: 10585

How can I make NetBeans run my Android project in the emulator?

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:

So I guess my questions are:

  1. Are there other things I can do to get NetBeans to launch my project, and
  2. If not (1), is there a way I can export the package and launch it from the command line using the tool directly?

Upvotes: 0

Views: 8054

Answers (3)

Radim
Radim

Reputation: 4808

Is your application deployed (if it is then it is possible that you need to customize your project settings and select it to launch (default) activity)?

Does the IDE/android plugin see your devices? Ctrl-5 and look and Android devices node to check if emulator or real device is connected.

-Radim

Upvotes: 1

Stevy888
Stevy888

Reputation: 364

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.

Upvotes: 0

jjNford
jjNford

Reputation: 5270

I know this is probably not the answer you want as it does not solve your problem but have you though about switcher to Eclipse (for Android Development). Google has made Eclipse very easy to use and has many great tools offered through the SKD to help with resources and debugging. The ADT also makes setup super simple. You can also control all of your Emulators from Eclipse.

Another reason I would recommend this is because I have imported Android projects into Eclipse that were created in other IDE's and they tend to be full of warnings and bugs that go against Google's best practice for Android development. Eclipse is really good about pointing these out so your application can meet its full potential.

As I said, probably not what you are looking for but I would definitely recommend using Eclipse instead.

Upvotes: 0

Related Questions