啟動調試器
首先在模擬器上啟動gdbserver:
adb shell
進入模擬器的控制台後
gdbserver 10.0.2.2:1234 /system/bin/libomstts
10.0.2.2是模擬器的默認ip地址,讓gdbserver在模擬器上監聽1234端口。如果啟動成功會顯示以下信息:
- Process /system/bin/libomstts created; pid = 1025
- Listening on port 1234
為來讓gdb能連接到模擬器上到gdbserver,必須進行數據轉發:
- telnet localhost 5554
- Trying 127.0.0.1...
- Connected to localhost.
- Escape character is '^]'.
- Android Console: type 'help' for a list of commands
- OK
- redir add tcp:1234:1234
- OK
- exit