During android app development, I do the following very often:
- Run “ant reinstall” to compile and upload an app to the emulator.
- Switch to the emulator window.
- Click on the package I just uploaded to run and test it.
Is there any way I can tell the emulator phone to run the package I just uploaded? Perhaps an “adb” command I can send to it after I’ve run my compile script? As a last resort, I guess I could run something that simulates the mouse click for me.
You want to use the
amcommand. Say you have a Manifest that looks kinda like this:you would start that with:
though you may want to tell it to wait till it’s ready:
Basically you’re just firing off an
Intentthat calls your package’s mainActivity.The full documentation (from running am –help) is: