Android的开发Eclipse的:总是打开新的模拟器 [英] Android Development on Eclipse: Always opens new emulator

查看:149
本文介绍了Android的开发Eclipse的:总是打开新的模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该是一个非常简单的问题。我做的Hello Android的教程中,我能得到我的应用程序安装到仿真器。但是,当我去再次运行(没有变化)Eclipse环境中坚持推出一个新的仿真器,而不是连接到现有的。我该如何解决呢?我的开发环境是一台Mac Mini运行Mac OS 10.6.8。

This should be a really simple one. I am doing the Hello Android tutorial and I was able to get my app to install into the emulator. However, when I go to run again (with no changes) the eclipse environment insists on launching a new emulator instead of connecting to the existing one. How do I fix that? My development environment is a Mac Mini running Mac OS 10.6.8.

感谢。

新的更新:

我已经找到了答案:

首先,我读这[由Mangusto上面链接问题] [1] <一href="http://stackoverflow.com/questions/8136268/use-same-android-emulator-everytime/8136352#8136352">Use同样的Andr​​oid模拟器每次

First I read this [question linked above by Mangusto][1] Use same android emulator everytime

后来我意识到,人真正需要做的,如果仿真器打开和初始化缓慢,是启动仿真器,等待它初始化,然后附加到它上面的链接描述的手工方式。如果你的模拟器开始慢慢断开连接,我在下面的更新描述自动不起作用。

Then I realized that what one really needs to do, if the emulator is opening and initializing slowly, is to start the emulator, wait for it to initialize, and then attach to it the manual way described in the link above. Automatic does not work if your emulator is starting slowly as it disconnects as I described in the update below.

感谢您的答复。

更新:

下面是日食打印出来(我想链接的图像,但不能因为我的用户级别。我需要10个或更多的信誉级别)。我已经尝试了以下的建议有关自动VS手册。我认为这个问题是,虽然安装apk文件并没有自动启动的仿真器。因此,日食从仿真器断开。我能看到我的应用程序通过导航到Android模拟器中的应用程序。
[2011-11-24 8点25分34秒 - SDK管理器]创建AVDmyAvd基于Android 4.0,ARM(armeabi-V7A)处理器,
[2011-11-24 8点25分34秒 - SDK管理器]以下硬件配置:
[2011-11-24 8点25分34秒 - SDK管理器] hw.lcd.density = 240V
[2011-11-24 8点25分34秒 - SDK管理器] vm.heapSize = 24
[2011-11-24 8点25分34秒 - SDK管理器] hw.ramSize = 512
[2011-11-24八时29分17秒 - HelloAndroid] ------------------------------
[2011-11-24八时29分17秒 - HelloAndroid]!Android的推出
[2011-11-24八时29分17秒 - HelloAndroid]亚洲开发银行运行正常
。 [2011-11-24八时29分17秒 - HelloAndroid]执行com.example.helloandroid.HelloAndroid活动推出
[2011-11-24八时29分17秒 - HelloAndroid]自动目标模式:启动新的仿真器兼容AVDmyAvd
[2011-11-24八时29分17秒 - HelloAndroid]启动一个新的仿真与虚拟设备myAvd
[2011年11月24日8点29分25秒 - 模拟器] 2011年11月24日08:29:25.377模拟器臂[984:部80b]警告一次:本申请,或库,它使用,使用NSQuickDrawView,其具有被撤销precated。应用程序应该停止使用的QuickDraw,并转移到石英。
[2011-11-24 8时29分25秒 - HelloAndroid]新模拟器发现:模拟器-5554
[2011-11-24 8时29分25秒 - HelloAndroid]等待HOME('android.process.acore)即将推出...
[2011-11-24八点31分29秒 - HelloAndroid] HOME是由设备'模拟器-5554
[2011-11-24八点31分29秒 - HelloAndroid]上传HelloAndroid.apk到器件的模拟器,5554'
[2011-11-24八点31分29秒 - HelloAndroid]安装HelloAndroid.apk ...
[2011-11-24 8时33分36秒 - HelloAndroid]!到设备'模拟器-5554安装HelloAndroid.apk失败
[2011-11-24 8时33分36秒 - HelloAndroid](空)
[2011-11-24 8时33分36秒 - HelloAndroid]到设备'模拟器-5554安装HelloAndroid.apk失败:由对
连接复位 [2011-11-24 8时33分36秒 - HelloAndroid] com.android.ddmlib.InstallException:连接复位
[2011-11-24 8时33分36秒 - HelloAndroid]启动取消
! [2011-11-24 8时34分55秒 - HelloAndroid] ------------------------------
[2011-11-24 8时34分55秒 - HelloAndroid]!Android的推出
[2011-11-24 8时34分55秒 - HelloAndroid]亚洲开发银行运行正常
。 [2011-11-24 8时34分55秒 - HelloAndroid]执行com.example.helloandroid.HelloAndroid活动推出
[2011-11-24 8时34分55秒 - HelloAndroid]自动目标模式:启动新的仿真器兼容AVDmyAvd
[2011-11-24 8时34分55秒 - HelloAndroid]启动一个新的仿真与虚拟设备myAvd
[2011-11-24八时35分03秒 - 仿真器】警告:已在使用数据分区。更改将不会持续! [2011-11-24 8时35分05秒 - 仿真器】警告:缓存已经在使用的分区。更改将不会持续! [2011-11-24 8点35分06秒 - 模拟器] 2011-11-24 08:35:06.756仿真臂[1004:80B]警告一次:这个应用程序,或者使用库,使用NSQuickDrawView,其中有被撤销precated。应用程序应该停止使用的QuickDraw,并转移到石英。
[2011-11-24 8点35分06秒 - HelloAndroid]新模拟器发现:模拟器-5556
[2011-11-24 8点35分06秒 - HelloAndroid]等待HOME('android.process.acore)即将推出...
[2011-11-24八时35分11秒 - HelloAndroid]仿真器 - 5556断开!取消com.example.helloandroid.HelloAndroid活动推出'!
[2011-11-24 8时42分36秒 - HelloAndroid] ------------------------------
[2011-11-24 8时42分36秒 - HelloAndroid]!Android的推出
[2011-11-24 8时42分36秒 - HelloAndroid]亚洲开发银行运行正常
。 [2011-11-24 8时42分36秒 - HelloAndroid]执行com.example.helloandroid.HelloAndroid活动推出
[2011-11-24 8时42分36秒 - HelloAndroid]自动目标模式:preferred AVDmyAvd不可用。启动新的仿真器。
[2011-11-24 8时42分36秒 - HelloAndroid]启动一个新的仿真与虚拟设备myAvd

Below is the print out from eclipse (I tried to link image but could not due to my user level. I need reputation level of 10 or more). I had already tried the suggestion below about automatic vs manual. I think the issue is that while the apk file was installed it did not automatically launch in the emulator. Therefore, eclipse disconnected from the emulator. I was able to see my application by navigating to the apps within the android emulator.
[2011-11-24 08:25:34 - SDK Manager] Created AVD 'myAvd' based on Android 4.0, ARM (armeabi-v7a) processor,
[2011-11-24 08:25:34 - SDK Manager] with the following hardware config:
[2011-11-24 08:25:34 - SDK Manager] hw.lcd.density=240v
[2011-11-24 08:25:34 - SDK Manager] vm.heapSize=24
[2011-11-24 08:25:34 - SDK Manager] hw.ramSize=512
[2011-11-24 08:29:17 - HelloAndroid] ------------------------------
[2011-11-24 08:29:17 - HelloAndroid] Android Launch!
[2011-11-24 08:29:17 - HelloAndroid] adb is running normally.
[2011-11-24 08:29:17 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-11-24 08:29:17 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAvd'
[2011-11-24 08:29:17 - HelloAndroid] Launching a new emulator with Virtual Device 'myAvd'
[2011-11-24 08:29:25 - Emulator] 2011-11-24 08:29:25.377 emulator-arm[984:80b] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-11-24 08:29:25 - HelloAndroid] New emulator found: emulator-5554
[2011-11-24 08:29:25 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-11-24 08:31:29 - HelloAndroid] HOME is up on device 'emulator-5554'
[2011-11-24 08:31:29 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2011-11-24 08:31:29 - HelloAndroid] Installing HelloAndroid.apk...
[2011-11-24 08:33:36 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2011-11-24 08:33:36 - HelloAndroid] (null)
[2011-11-24 08:33:36 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554': Connection reset by peer
[2011-11-24 08:33:36 - HelloAndroid] com.android.ddmlib.InstallException: Connection reset by peer
[2011-11-24 08:33:36 - HelloAndroid] Launch canceled!
[2011-11-24 08:34:55 - HelloAndroid] ------------------------------
[2011-11-24 08:34:55 - HelloAndroid] Android Launch!
[2011-11-24 08:34:55 - HelloAndroid] adb is running normally.
[2011-11-24 08:34:55 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-11-24 08:34:55 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAvd'
[2011-11-24 08:34:55 - HelloAndroid] Launching a new emulator with Virtual Device 'myAvd'
[2011-11-24 08:35:03 - Emulator] WARNING: Data partition already in use. Changes will not persist! [2011-11-24 08:35:05 - Emulator] WARNING: Cache partition already in use. Changes will not persist! [2011-11-24 08:35:06 - Emulator] 2011-11-24 08:35:06.756 emulator-arm[1004:80b] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2011-11-24 08:35:06 - HelloAndroid] New emulator found: emulator-5556
[2011-11-24 08:35:06 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-11-24 08:35:11 - HelloAndroid] emulator-5556 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
[2011-11-24 08:42:36 - HelloAndroid] ------------------------------
[2011-11-24 08:42:36 - HelloAndroid] Android Launch!
[2011-11-24 08:42:36 - HelloAndroid] adb is running normally.
[2011-11-24 08:42:36 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-11-24 08:42:36 - HelloAndroid] Automatic Target Mode: Preferred AVD 'myAvd' is not available. Launching new emulator.
[2011-11-24 08:42:36 - HelloAndroid] Launching a new emulator with Virtual Device 'myAvd'

推荐答案

它的,因为你的应用目标模式设置为手动。解决:

Its because your application Target mode has set to manual. To solve :

Right Click on your project-> Run as -> Select Run Configurations ->
In that select Target Tab ->Select Automatic instead of manual 

点击应用运行

现在您的应用程序不会提示输入设备。

Now your app doesn't prompt for a device.

对于逆转情况下,选择手动

希望它帮助。

这篇关于Android的开发Eclipse的:总是打开新的模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆