op.sh: adb (#34468)

* add op adb

* adb_shell.sh

* su comma

* add to op output
This commit is contained in:
Mauricio Alvarez Leon
2025-02-22 11:24:03 -08:00
committed by GitHub
parent 5bc58e0b36
commit d15d77f7bb
2 changed files with 15 additions and 0 deletions

8
tools/adb_shell.sh Executable file
View File

@@ -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

View File

@@ -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
}