From 43bd1d448a5cfcfe57f47a9900396ce733e3c0f6 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 30 Jul 2014 14:13:50 +0200 Subject: [PATCH] [script] Android attach gdb to target --- scripts/attachSystem.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/attachSystem.sh 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 +