Whenever I run my app I get the Android Device Chooser dialog:
This is happening because I am using the Google APIs for 1.6 and trying to run the application on my Nexus one. Is there any way to make this automatically, or to not check the compatibility? Sometimes when I make a modification and quickly after I save and run the application, Eclipse will build the project and the Android Device Chooser dialog will show briefly and disappear and the app won’t run. I have to click run again for it to work. Any workarounds?
Then, do not forget to To go in
In the “
Launch Operation” subsection, select “
Always launch the previously launched application”:
Create a run configuration.
Run -> Run Configurations.
Select your project and specify your target and from then on run that configuration when you run that app.
The key is the very top line in the screen shot of your Android Device Chooser. Notice that it is asking you to select a device compatible with a Google API target. This dialog only ignores your launch preference when the Android version you selected in your project’s properties is one of the “GoogleAPIs” type. Choosing one of the Android Open Source Project versions will respect your launching preferences.
This is a bug (or intentional behavior) in ADT when anything other than a stock SDK version is selected. You will experience this when targeting “Google APIs” rather than a plain Android SDK.
For the details, see the implementation of
AndroidLaunchController.java within the adt project. (Basically, whenever you target something other than a plain SDK, it can’t tell if the attached device satisfies the requested libraries, in this case Google APIs.)
Just set the ‘target’ tab to the ‘Automatic’ option and it will launch on your device automatically.