我很有兴趣通过usb查看adb客户端和adbd之间发送的数据包。我尝试将环境变量ADB_TRACE设置为1.但是当我运行“adb shell”但shell出现时,我无法看到任何痕迹。任何帮助将不胜感激
答案 0 :(得分:4)
试试adb logcat
。这将显示日志。
答案 1 :(得分:1)
下面的补丁应该可以帮到你。更多信息出现在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
答案 2 :(得分:0)
您只需要在终端中键入一些命令即可:
adb kill-server
export ADB_TRACE=all
adb start-server