问题:使用 eclipse 调试android程序时,log太多,且自动清除,来不及看?
解决方案:
1.找到 adb.exe (C:\xiaofan\android\eclipse_4_4_android\adt-bundle-windows-x86_64\sdk\platform-tools)
2.打开cmd,输入如下命令并回车:
adb logcat > C:\xiaofan\tools\a.txt
如果提示:
- waiting for device -
error: more than one device/emulator
这是因为有多个设备或者模拟器 (我这是是有多个模拟器)
3. 查看 adb devices ,显示如下:
List of devices attached
HC47LMPE0094 device
emulator-5582 host
emulator-5578 host
找到我的测试机 HC47LMPE0094 device
4.使用 adb -s HC47LMPE0094 logcat > C:\xiaofan\tools\a.txt
操作完成之后,按下Ctrl+C,停止该命令的执行,即可在相应目录下看到log文件