How to inject a message into logcat via adb

时间:2016-08-31 17:39:44

标签: android

Is there a way to inject a message into the logcat buffer via adb? This could be useful if for testing and development.

(SO requires me to write more here, so I am writing more here (ignore this line)).

1 个答案:

答案 0 :(得分:7)

Use the device-side 'log' command. Example:

adb shell log -t my_tag "About to send broadcast..."

The result in logcat will look like:

08-31 10:33:18.750  7081  7081 I my_tag  : About to send broadcast...