2011-04-26 136 views
4

我有興趣查看adb客戶端和adbd之間通過usb發送的數據包。我嘗試將環境變量ADB_TRACE設置爲1.但是,當我運行「adb shell」(雖然shell彈出)時,我無法看到任何痕跡。任何幫助將不勝感激如何啓用adb跟蹤

回答

4

嘗試adb logcat。這會告訴你日誌。

+1

找到它,日誌存在於/tmp/adb.log – alvin 2011-04-27 06:07:20

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