【问题标题】:Have to open emulator 3 times to get the app running every time i open eclipse每次打开 Eclipse 时都必须打开模拟器 3 次才能运行应用程序
【发布时间】:2013-05-28 07:44:11
【问题描述】:

当我打开 eclipse 并加载所有文件并运行我的应用程序时,模拟器打开,之后我在控制台中收到错误。

所以当我再次关闭模拟器并再次运行应用程序时,我在控制台中遇到了同样的错误。

最后,当我第三次运行应用程序时,它会被安装并启动 apk。每次我打开 Eclipse 时都会发生这种情况。

有什么问题?

控制台日志:

        [2013-06-01 20:10:58 - CalendarDemo] ------------------------------
   [2013-06-01 20:10:58 - CalendarDemo] Android Launch!
[2013-06-01 20:10:58 - CalendarDemo] adb is running normally.
[2013-06-01 20:10:59 - CalendarDemo] Performing com.indianic.demo.calendark.CalendarActivity activity launch

 [2013-06-01 20:10:59 - CalendarDemo] Automatic Target Mode: Preferred AVD '53' is not available. Launching new emulator.
      [2013-06-01 20:10:59 - CalendarDemo] Launching a new emulator with Virtual Device '53'
[2013-06-01 20:11:29 - Emulator] Failed to create Context 0x3005
 [2013-06-01 20:11:29 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
[2013-06-01 20:11:30 - Emulator] emulator: emulator window was out of view and was recentered
 [2013-06-01 20:11:30 - Emulator] 
  [2013-06-01 20:11:30 - CalendarDemo] New emulator found: emulator-5554
    [2013-06-01 20:11:30 - CalendarDemo] Waiting for HOME ('android.process.acore') to be launched...
  [2013-06-01 20:12:46 - CalendarDemo] emulator-5554 disconnected! Cancelling 'com.indianic.demo.calendark.CalendarActivity activity launch'!
     [2013-06-01 20:19:55 - CalendarDemo] ------------------------------
      [2013-06-01 20:19:55 - CalendarDemo] Android Launch!
      [2013-06-01 20:19:55 - CalendarDemo] adb is running normally.
         [2013-06-01 20:19:55 - CalendarDemo] Performing com.indianic.demo.calendark.CalendarActivity activity launch
   [2013-06-01 20:19:55 - CalendarDemo] Automatic Target Mode: Preferred AVD '53' is not available. Launching new emulator.
    [2013-06-01 20:19:55 - CalendarDemo] Launching a new emulator with Virtual Device '53'
     [2013-06-01 20:20:20 - Emulator] Failed to create Context 0x3005
   [2013-06-01 20:20:20 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
  [2013-06-01 20:20:21 - Emulator] emulator: emulator window was out of view and was recentered

    [2013-06-01 20:20:21 - Emulator] 
[2013-06-01 20:20:21 - CalendarDemo] New emulator found: emulator-5554
[2013-06-01 20:20:21 - CalendarDemo] Waiting for HOME ('android.process.acore') to be launched...
     [2013-06-01 20:21:14 - CalendarDemo] HOME is up on device 'emulator-5554'
 [2013-06-01 20:21:14 - CalendarDemo] Uploading CalendarDemo.apk onto device 'emulator-5554'
[2013-06-01 20:21:16 - CalendarDemo] Installing CalendarDemo.apk...
[2013-06-01 20:22:18 - CalendarDemo] Success!

【问题讨论】:

  • 您可能想[关注此线程][1] 它包含相同的错误 [1]:stackoverflow.com/questions/15652311/…
  • @user1549804 对答案的评论说改变内存大小不会停止警告
  • 警告是一个已知问题 - 问题 47829。当 eclipse 报告模拟器断开连接时,不是关闭并重新打开模拟器,而是重新启动 adb 可能有助于在同一个模拟器上部署应用程序。
  • @Rajesh 如何重启 adb.?
  • 进入DDMS透视图,点击“Devices”标签最右侧的下拉菜单,选择“Reset adb”

标签: java android android-emulator adb


【解决方案1】:

试试这个

首先,启动您想要的模拟器,然后执行以下步骤,

第 1 步: 右键单击​​您的项目 -> 运行方式 -> 运行配置

第二步:会有3个标签,Android | Target | Common,点击Target

第三步:在部署目标选择模式中,选择第一个选项Always prompt to pick device

第四步:点击Apply,然后点击Run

因此,您将获得当前可用设备的列表,您可以选择所需的设备并在其上运行应用程序。

希望对你有帮助!!

【讨论】:

  • 我希望我的应用程序始终在 android 4.1.1 上运行,所以我从运行配置中选择了它。没有其他出路?
  • @Metalhead1247: 在Step 3 中,您可以选择third 选项而不是first 选项
  • 谢谢!!但是我的一个应用程序在 2.3 和 4.1.1 中兼容,但我希望它始终在 4.1.1 中打开?
  • 你可以改变目标 api.just right click on that application -> properties -> select desired api level(in your case API 16) as target for compilation -> click ok
  • 虽然遵循我在之前评论中提到的步骤。
【解决方案2】:

转到窗口->首选项->Android->DDMS。

将 adb timeout 的值更改为 10000。

由于模拟器启动需要很长时间,所以adb超时,连接丢失
因此未安装该应用程序。

【讨论】:

    猜你喜欢
    • 2014-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多