2016-11-22 44 views
0

我正在開發一個包含本機部分的android應用程序。我無法調試本機部件,它不會給出任何錯誤。等待了一段時間後,我開始應用程序,它會發出以下警告,但它不會崩潰,只是凍結和等待。本機應用程序啓動時會凍結

V/ActivityThread: Handling launch of ActivityRecord{5b69371 [email protected] {com.mcg.realtimeaudiosynthesis/com.mcg.realtimeaudiosynthesis.MainActivity}} 
D/MessageLogger: >>> Entering MessageLogger.dump. to Dump MSG HISTORY <<< 
D/MessageLogger: MSG HISTORY IN MAIN THREAD: 
       Current kernel time : 9189711ms 
       Last record : Msg#:4 >>>>> Dispatching to Handler (android.app.ActivityThread$H) {377158fb} null: 100 
       Last record dispatching elapsedTime:8085 ms/upTime:8086 ms 
       Last record dispatching time : 2016-11-22 14:00:52.839 
       Msg#:3 <<<<< Finished to Handler (android.app.ActivityThread$H) {377158fb} null elapsedTime:14 ms/upTime:14 ms 
       Msg#:2 >>>>> Dispatching to Handler (android.app.ActivityThread$H) {377158fb} null: 110 from 2016-11-22 14:00:52.825 
       Msg#:1 <<<<< Finished to Handler (android.app.ActivityThread$H) {377158fb} null elapsedTime:0 ms/upTime:1 ms 
       Msg#:0 >>>>> Dispatching to Handler (android.app.ActivityThread$H) {377158fb} null: 138 from 2016-11-22 14:00:52.824 
       === Finish Dumping MSG HISTORY=== 
       === LONGER MSG HISTORY IN MAIN THREAD === 
       === Finish Dumping LONGER MSG HISTORY=== 
D/MessageQueue: Dump first 20 messages in Queue: 
D/MessageQueue: Dump Message in Queue (1): { when=-7s725ms what=149 [email protected] target=android.app.ActivityThread$H [email protected] } 
D/MessageQueue: Total Message Count: 1 
I/art: Thread[9,tid=4357,WaitingInMainSignalCatcherLoop,Thread*=0xb3906400,peer=0x12c40080,"Signal Catcher"]: reacting to signal 3 
I/art: Wrote stack traces to '/data/anr/traces.txt' 

在調試器上,幾個步驟後調試消失,但我仍然連接。有沒有辦法詳細追蹤原生錯誤?

回答

1

有沒有一種方法來詳細跟蹤本機錯誤?

對於您的特殊情況,您可以獲得更多信息。您的應用已陷入ANR(應用程序無響應)狀態,並在這裏:

I/art: Wrote stack traces to '/data/anr/traces.txt' 

你可以找到目前你的應用程序的所有線程的堆棧跟蹤當系統檢測到ANR條件。也許還有其他一些有用的位。即使沒有root權限,該文件也應該可以訪問。剛剛運行:

$ adb shell "cat /data/anr/traces.txt"