問題:使用 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文件