如何调试在手机休眠模式的Andr​​oid应用程序,无需USB连接

问题描述:

这是很微妙的,我猜。手机的行为不同,当与USB(调试),并拔掉电源线时,连接。不同的是在睡眠模式 - 用USB连接手机似乎更加活跃,反应灵敏,无 - 少。例如,我有一个闹钟唤醒了电话,调整音量。虽然连接 - 工作完全正常的睡眠(调整对每个报警触发,每10秒钟卷)。虽然没有连接 - 作品很少(仅调整随机触发报警音量,让我们说20和50之间秒)

That's tricky one, I guess. Phone behaves differently when connected with USB (for debugging) and when unplugged. Difference is in the sleep mode - with USB connection phone seems to be more active and responsive, without - less. For example, I have an alarm to wake up the phone and adjust volume. While connected - works perfectly fine in sleep (adjusts volume on every alarm trigger, every 10 seconds). While not connected - works rarely (adjusts volume only on random alarm trigger, let's say between 20 and 50 seconds).

我怎么能调试,同时拔掉电话吗?我怎么能强迫手机的行为如出一辙与USB连接和不?部分唤醒锁(一个没有屏幕上)并没有帮助。这是奇怪的,它使发展中国家真的很痛苦。

How could I debug the phone while unplugged? How could I force the phone to behave exactly the same with USB connection and without? Partial wake lock (the one without screen on) doesn't help. This is strange and it makes the developing really painful.

这是很容易的,但简单的答案总是放在最后:笔者从市场安装aLogcat,它似乎工作得很好!伟大的应用程序,看看日志不用电脑,直接在手机上。

This was quite easy, but the easy answers always come last: I installed aLogcat from the market and it seems to work just fine! Great app to see the logs without the computer, straight on the phone.