[script] Android attach gdb to target

This commit is contained in:
Mathieu Maret 2014-07-30 14:13:50 +02:00 committed by Mathieu Maret
parent 6d8862191c
commit 43bd1d448a

10
scripts/attachSystem.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
if [[ $# -eq 0 ]]; then
adb wait-for-device && adb forward tcp:5039 tcp:5039
pid=$(adb shell ps | grep system_server | awk '{print $2}')
adb shell gdbserver :5039 --attach $pid
else
adb wait-for-device && adb forward tcp:5040 tcp:5040 && adb shell gdbserver :5040 --attach $( adb shell ps | grep $@ | awk '{print $2}')
fi