Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: platform_tools/android/bin/android_gdb_app

Issue 2055453003: Support running Viewer via android_gdb_app (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/android_gdb_app
diff --git a/platform_tools/android/bin/android_gdb_app b/platform_tools/android/bin/android_gdb_app
index 046fee3dea4b3f1361e19490e7e927d5e90f6cf9..68d517b9a0b1862620a539bc5c20cf831b547c41 100755
--- a/platform_tools/android/bin/android_gdb_app
+++ b/platform_tools/android/bin/android_gdb_app
@@ -5,12 +5,26 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh "$@"
+source $SCRIPT_DIR/utils/setup_adb.sh
-APP_NAME=${APP_ARGS[0]}
+app=${APP_ARGS[0]}
+if [[ ${app} == '-'* ]]; then
+ echo "Defaulting to running SampleApp."
+ app="SampleApp"
+ APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
+fi
PORT=5039
-source $SCRIPT_DIR/utils/setup_adb.sh
-
+if [[ ${app} == 'SampleApp' ]]; then
+ activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
+ activityShort="com.skia.sample_app"
+elif [[ ${app} == "Viewer" ]] ; then
+ activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
+ activityShort="org.skia.viewer"
+else
+ echo "ERROR: supports either 'SampleApp' or 'Viewer' as valid apps"
+ exit 1
+fi
# Forward local to remote socket connection.
$ADB $DEVICE_SERIAL forward "tcp:$PORT" "tcp:$PORT"
@@ -34,13 +48,13 @@ adb_push_if_needed $ANDROID_TOOLCHAIN/gdbserver /data/local/tmp
# Launch the app
echo "Launching the app..."
-$ADB $DEVICE_SERIAL shell am start -n com.skia.sample_app/com.skia.SkiaSampleActivity
+$ADB $DEVICE_SERIAL shell "am start -n ${activity} --es cmdLineFlags \"${APP_ARGS[*]:1}\""
# Wait for app process to initialize
sleep 2
# Attach gdbserver to the app process
-PID=$($ADB shell ps | grep com.skia.sample_app | awk '{print $2}')
+PID=$($ADB shell ps | grep ${activityShort} | awk '{print $2}')
echo "Attaching to pid: $PID"
$ADB $DEVICE_SERIAL shell /data/local/tmp/gdbserver :$PORT --attach $PID &
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698