开发者

Is there a way to get copy-and-pastable debug output in the Android SDK Emulator?

开发者 https://www.devze.com 2022-12-14 21:01 出处:网络
I have some information generated in the Android Emulator, and the only way I can see to get it out is using the Log class.

I have some information generated in the Android Emulator, and the only way I can see to get it out is using the Log class.

However, you cannot copy-and-paste from the DDMS log window. This is really annoying as I cannot use the information in another application, for开发者_如何学Python example, without retyping it.

Is there a better way to get debug information out of the emulator? What happens when you write more complex applications? What do you do when you need to verify it is writing correct information to URLs, databases, files etc?

Thanks!


Using the DDMS logcat window you can select lines and copy and paste text to other windows.

If you use java.util.logging instead of the Log class you could attach a handler to write the log file out to a text file if that would make things easier. Logcat is still available when using java.util.logging but by default INFO and above is only available.


You could just use the command line logcat utility: adb logcat


Left click on a line, then CTRL + C to copy. If you wan the entire log, CTRL + A to select all, and then CTRL + C. Paste it anywhere you want.


LogCat Rows are called items.

Each item has several attributes. Currently, you can only select one or more items and do the following things:

-Copy with ctrl+c

-Save to a text file using the save button.
0

精彩评论

暂无评论...
验证码 换一张
取 消