How to copy logcat output to clipboard?

后端 未结 9 2256
忘了有多久
忘了有多久 2020-12-01 13:42

I\'m developing android apps in eclipse and how can I get logcat messages to my clipboard?

相关标签:
9条回答
  • 2020-12-01 14:09

    Ctrl + C works but you need to make sure to make sure you click on the first line of any output that is split into multiple lines.

    0 讨论(0)
  • 2020-12-01 14:12

    For those of you working with Eclipse on a Macintosh, here's a work-around:

    • Highlight the parts of the logcat you want to copy to the clipboard (or just select everything by clicking ctrl-a when the logcat window is active)
    • Click on the "save" icon (it looks like a floppy disk)
    • Save it to a convenient location
    • Open the log file in another text editor (use your favorite that is NOT eclipse)
    • Select what you want
    • Now type ctrl-c to copy to the clipboard

    Yup, I know; it's a pain in the ass, but it works.

    0 讨论(0)
  • 2020-12-01 14:14

    Also notable is that as of at least ADT plugin version 21 there is a TID column displayed in Eclipse's logcat viewer when you have display settings on maximum verbosity, but the thread id will not be preserved if you copy and paste the content of this view. Instead you'll see something like [debug level] [timestamp] [invocation] (PID)... but no thread id. I don't know if there is an easier way to grab the TID data directly from eclipse, but it can be done using a remote adb shell as follows:

    Execute the following from your PC's command line: adb -s [your device's serial number] shell "logcat -v threadtime" > [your_output_file]

    your session will appear to hang, but in actuality the device's logcat output, exactly as shown in eclipse's logcat view including the TID, is being written in real time to your output file. When you want to view the content, exit the logcat dump process with ctrl+c and open the file on your PC. Other options for logcat filtering etc. can be found [here].1

    0 讨论(0)
  • 2020-12-01 14:16

    put cursor in the logcat window. ctrl-a select all ctrl-c copy what's selected (which will be all) run vi then paste.

    0 讨论(0)
  • 2020-12-01 14:21

    You can click on the output line in LogCat and click ctrl+c like normal then a normal paste into whatever you want. You can use shift and click to select multiple lines.

    0 讨论(0)
  • 2020-12-01 14:21

    From a command line:

    adb logcat > log.txt
    
    0 讨论(0)
提交回复
热议问题