How do I enable adb tracing
I am intrested in viewing the packets sent by between adb client 开发者_如何学编程and adbd through usb. I tried setting the environment variable ADB_TRACE to 1. But when I run "adb shell" though the shell comes up, I am not able to see any traces. Any help will be appreciated thanks
Try adb logcat
. That will show you the log.
Below patch should help you. More info is present at https://events.linuxfoundation.org/images/stories/pdf/lf_abs12_kobayashi.pdf
diff --git a/adb/adb.h b/adb/adb.h
index 622ca70..ecf9597 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -379,7 +379,7 @@ void adb_qemu_trace(const char* fmt, ...);
extern unsigned char adb_trace_output_count;
void adb_trace_init(void);
-# define ADB_TRACING ((adb_trace_mask & (1 << TRACE_TAG)) != 0)
+# define ADB_TRACING 1//((adb_trace_mask & (1 << TRACE_TAG)) != 0)
/* you must define TRACE_TAG before using this macro */
# define D(...) \
@@ -415,7 +415,7 @@ void adb_qemu_trace(const char* fmt, ...);
#endif
-#if !DEBUG_PACKETS
+#if 1//!DEBUG_PACKETS
#define print_packet(tag,p) do {} while (0)
#endif
You just need to type some commands in the terminal:
adb kill-server
export ADB_TRACE=all
adb start-server
精彩评论