开发者

Is there a way to hide the Android Device Chooser?

开发者 https://www.devze.com 2022-12-25 22:56 出处:网络
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 the

Whenever I run 开发者_高级运维my app I get the Android Device Chooser dialog:

Is there a way to hide the Android Device Chooser?

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?


Once you have installed ADT, you need to define an ADT launch configuration, in order for your project to execute itself as an Android executable.

Is there a way to hide the Android Device Chooser?


(source: google.com)


Then, do not forget to To go in Eclipse->Preferences->Run/Debug->Launching.
In the “Launch Operation” subsection, select “Always launch the previously launched application”:

Is there a way to hide the Android Device Chooser?


(source: turbulent.ca)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消