Android:从eclipse调试仿真器的问题 [英] Android: Problems debugging with the emulator from eclipse

查看:213
本文介绍了Android:从eclipse调试仿真器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我疯狂了像这些人一样, slow-android-emulator ,我发现运行模拟器从日食是缓慢和有问题的。如所建议的,我已经尝试单独运行模拟器。但是,我没有得到我最新的更改。我不太了解eclipse,但是我会喜欢build,然后以某种方式将最新的图像加载到模拟器中。

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.

另外,我试过保持模拟器打开,并持续使用run-> debug,但是在2或3次之后,我会收到如下错误:

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)

我尝试杀死并重新启动adb服务器无效。

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.

推荐答案

模拟器通常很慢,但一旦启动,我从来没有重新启动。

The emulator is usually slow, but once started usually I never had to restart.

如果您觉得从eclipse外面运行模拟器更快,那么您可以在eclipse之外运行模拟器,并在Android应用程序Run - > Configuration中选择首选avd,并取消选中自动目标模式。 (还告诉我,你的日食可能没有足够的内存,如果你已经分配了很少的内存,那么你需要更改vmargs)稍后再说一遍。

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.

(注意:请尝试使用Jconsole或其他一些剖析器并粘贴内存使用情况,或至少检查任务管理器中的内存使用情况。)

(Note: Please try using Jconsole or some other profiler and paste the memory usage or at least check memory usage in task manager.)

这篇关于Android:从eclipse调试仿真器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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