From d15d77f7bbef3db09c6928a69321df97fe0ef08d Mon Sep 17 00:00:00 2001 From: Mauricio Alvarez Leon <65101411+BBBmau@users.noreply.github.com> Date: Sat, 22 Feb 2025 11:24:03 -0800 Subject: [PATCH] `op.sh`: adb (#34468) * add op adb * adb_shell.sh * su comma * add to op output --- tools/adb_shell.sh | 8 ++++++++ tools/op.sh | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100755 tools/adb_shell.sh diff --git a/tools/adb_shell.sh b/tools/adb_shell.sh new file mode 100755 index 0000000000..985c5c0726 --- /dev/null +++ b/tools/adb_shell.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env expect +spawn adb shell +expect "#" +send "cd usr/comma\r" +send "export TERM=xterm-256color\r" +send "su comma\r" +send "clear\r" +interact diff --git a/tools/op.sh b/tools/op.sh index c6abde67a3..b4508f7ef7 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -273,6 +273,11 @@ function op_venv() { esac } +function op_adb() { + op_before_cmd + op_run_command tools/adb_shell.sh +} + function op_check() { VERBOSE=1 op_before_cmd @@ -390,6 +395,7 @@ function op_default() { echo -e " ${BOLD}juggle${NC} Run PlotJuggler" echo -e " ${BOLD}replay${NC} Run Replay" echo -e " ${BOLD}cabana${NC} Run Cabana" + echo -e " ${BOLD}adb${NC} Run adb shell" echo "" echo -e "${BOLD}${UNDERLINE}Commands [Testing]:${NC}" echo -e " ${BOLD}sim${NC} Run openpilot in a simulator" @@ -446,6 +452,7 @@ function _op() { stop ) shift 1; op_stop "$@" ;; restart ) shift 1; op_restart "$@" ;; post-commit ) shift 1; op_install_post_commit "$@" ;; + adb ) shift 1; op_adb "$@" ;; * ) op_default "$@" ;; esac }