diff --git a/scripts/attachSystem.sh b/scripts/attachSystem.sh new file mode 100755 index 0000000..8a81743 --- /dev/null +++ b/scripts/attachSystem.sh @@ -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 +