Android:使用 Eclipse 模拟器进行调试时出现问题
这让我发疯。像这些人一样,slow-android-emulator,我发现运行模拟器eclipse 很慢而且有问题。正如建议的那样,我尝试单独运行模拟器。但后来我没有得到最新的更改。我不太了解 eclipse,但我想要类似“构建”的东西,然后以某种方式将最新的图像加载到模拟器中。
另外,我尝试保持模拟器打开并不断使用 run->debug,但经过 2 或 3 次后,我收到如下错误:
Failed to install HelloAndroid.apk on device 'emulator-5554': timeout
Launch canceled!
emulator: ERROR: the user data image is used by another emulator. aborting
Waiting for HOME ('android.process.acore') to be launched...
emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
java.lang.NullPointerException
at com.android.ddmlib.Client.sendAndConsume(Client.java:571)
at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)
at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
我尝试终止并重新启动 adb 服务器,但无济于事。
再次简单地说,我只想要一个“系统”,我可以在其中有效地进行更改,将它们加载到模拟器中并进行测试。
This is driving me crazy. Like these people, slow-android-emulator, I'm finding running the emulator from eclipse is slow and problematic. As suggested, I've tried running the emulator seperately. But then I don't get my latest changes. I don't know eclipse that well, but I would like something like 'build' and then somehow load the latest image into the emulator.
Also, I've tried keeping the emulator open and the continually use run->debug, but after 2 or 3 times, I get errors like the following:
Failed to install HelloAndroid.apk on device 'emulator-5554': timeout
Launch canceled!
emulator: ERROR: the user data image is used by another emulator. aborting
Waiting for HOME ('android.process.acore') to be launched...
emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
java.lang.NullPointerException
at com.android.ddmlib.Client.sendAndConsume(Client.java:571)
at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)
at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
I've tried killing and restarting the adb server to no avail.
Once again, briefly, I would just like a 'system' where I can effectively make changes, load them into the emulator and test.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
模拟器通常很慢,但一旦启动通常我就不必重新启动。
如果您觉得从 eclipse 外部运行模拟器更快,那么您可以在 eclipse 外部运行模拟器并在 android 应用程序中运行 -->配置中,可以选择“首选avd”并取消选中自动目标模式。 (它还告诉我你的 Eclipse 可能没有足够的内存。如果你分配的内存很少,你需要更改 vmargs。稍后会详细介绍)。
此外,当您在进行一些代码更改后想要再次调试时,您是否关闭调试会话(调试窗口中的红色按钮)并启动一个新的调试会话。模拟器不能很好地处理热插拔。
(注意:请尝试使用 Jconsole 或其他分析器并粘贴内存使用情况或至少检查任务管理器中的内存使用情况。)
The emulator is usually slow, but once started usually I never had to restart.
If you feel that running emulator from outside eclipse is faster, then you can run the emulator outside eclipse and in the android application Run --> Configuration, you can choose "preferred avd" and uncheck automatic target mode. (Also it tells me that your eclipse probably does not have enough memory. You need to change vmargs if you have allocated very little memory. More on that later).
Also when you want to debug again after making some code change, are you closing the debugging session (The red button in your debug window) and starting a new one. The emulator does not handle hot swapping all that well.
(Note: Please try using Jconsole or some other profiler and paste the memory usage or at least check memory usage in task manager.)
请尝试取消当前的 avd(模拟器)并再次启动该 avd(模拟器)。
please try current avd(emulator) cancel and again start that avd(emulator).