Android Emulator不会运行从eclipse启动的应用程序

Chr*_*ang 28 eclipse android android-emulator

我已经关注了谷歌Android开发人员指南中的"Hello World"示例.当我尝试在SDK模拟器中运行应用程序时,没有任何反应.模拟器启动很好,但之后没有任何反应.我甚至无法在应用程序托盘中看到该应用程序.

我正在使用安装了Android附加组件的Eclipse.

小智 30

遇到同样的问题,控制台日志在以下情况后停滞:

使用虚拟设备启动新的模拟器

并且模拟器从未显示过HelloAndroid应用程序.我终于想通了!在Eclipse中去

运行 - >运行配置

然后将应用程序的启动操作(例如HelloAndroid)从"启动默认活动"更改为"启动:",然后从下拉菜单中选择您的应用程序.这对我有用.

HTH,斯文

  • 这并没有完全解决我的问题,但这是朝着正确方向迈出的一步.我试图让一个示例应用程序运行,我发现它没有列出任何活动,所以显然也没有默认值. (2认同)

bar*_*dub 27

同样在这里; 模拟器加载很好但apk没有安装.问题仅出在模拟器上.如果打开USB调试设备的物理连接,一切正常.

NB突然之间,这种情况突然发生了.一切都习以为常.

我已经尝试卸载并重新安装ADT插件,并且已经将Android SDK和AVD Manager更新到最新版本.(工具修订版7)但问题仍然存在.

Eclipse:Helios Service Release 1 Build id:20100917-0705在Windows XP SP2上运行

正如其他人发布的一样,控制台日志显示

[2010-10-14 11:39:33 - uad-MediaPlayerExample] ------------------------------
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Android Launch!
[2010-10-14 11:39:33 - uad-MediaPlayerExample] adb is running normally.
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Performing com.msi.manning.chapter10.MediaPlayerExample.MediaPlayerActvity activity launch
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Automatic Target Mode: launching new emulator with compatible AVD '1.6-hvga'
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Launching a new emulator with Virtual Device '1.6-hvga'
Run Code Online (Sandbox Code Playgroud)

LogCat保持为空/空白.

如果我然后尝试重新运行相同的应用程序,控制台会显示:

[2010-10-14 11:39:33 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting
Run Code Online (Sandbox Code Playgroud)

可能的答案??? 一个解决方案似乎是在Windows任务管理器中杀死adb.exe进程(当模拟器仍在运行时). 任务管理器的截图

(来自http://vikashazrati.wordpress.com/2008/01/01/quicktip-android-does-not-load-my-application-in-the-emulator/)

控制台突然显示很多错误:

[2010-10-14 12:12:00 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:01 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:01 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:02 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:02 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:03 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:03 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:04 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:04 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:05 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:06 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:06 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
Run Code Online (Sandbox Code Playgroud)

但应用程序在模拟器中启动.!

(正如预期的那样,LogCat也突然开始显示大量消息)

一切正常 - 即你可以处理你的代码并在同一个模拟器中重新运行应用程序,并按预期重新安装...

但是,如果您关闭模拟器,您会看到以下控制台错误:

[2010-10-14 12:15:05 - DeviceMonitor]Sending jdwp tracking request failed!
Run Code Online (Sandbox Code Playgroud)

并且同样的问题再次出现 - 出现了一个新的模拟器,但没有安装apk.因此,您需要返回Windows任务管理器并再次终止adb.exe进程.

注意我发现adb.exe没有重新出现在任务管理器中,除非我重新启动Eclipse,因此关闭模拟器后你必须重新启动Eclipse,尝试运行(无法显示应用程序)然后返回任务管理器adb .exe再次列出并终止应用程序启动的过程.

如果有人可以为此提供解释并永久修复,那将会很棒......


小智 10

我有类似的问题.我建议以下解决方法:

  1. 在任务管理器中关闭eclipse,杀死所有adb和emulator*进程.
  2. 启动eclipse,运行你的应用程序,等到模拟器启动.如果您遇到问题,您的应用程序将无法启动,将会有裸模拟器.
  3. 在eclipse中,选择Window-> Open Perspective-> Other-> DDMS.切换到DDMS透视图.如果您遇到问题,设备列表将为空.
  4. 在"设备"选项卡的下拉框中,选择"重置adb".在不久的将来,仿真器必须出现在设备列表中.
  5. 然后,切换回Java透视图并运行您的应用程序.在剩下的会话中,一切都必须正常工作.