Template
builder & dev tools
This commit is contained in:
1 parent
c0ad0d49f2
commit
ae63f8b9a3
26 files changed
+1504
-1
No files matched your search
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
||||
source scripts/lib.sh
|
||||
|
||||
need_cmd "$ADB" "$PY"
|
||||
|
||||
usage() {
|
||||
cat >&2 <<'EOF'
|
||||
usage: scripts/debug.sh start|stop [--platform vscode|pycharm]
|
||||
|
||||
Requires the device-side debugger package to be present in the app's Python
|
||||
runtime: `debugpy` for vscode, `pydevd-pycharm` for pycharm. If it is not
|
||||
installed, add it to "requirements" in plugin.json so the app's pip
|
||||
controller installs it on next load.
|
||||
EOF
|
||||
}
|
||||
|
||||
[[ $# -ge 1 ]] || { usage; exit 1; }
|
||||
ACTION="$1"
|
||||
shift
|
||||
PLATFORM=vscode
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--platform)
|
||||
PLATFORM="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
--platform=*)
|
||||
PLATFORM="${1#--platform=}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
die "unknown argument: $1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "$ACTION" in
|
||||
start|stop) ;;
|
||||
*) usage; exit 1 ;;
|
||||
esac
|
||||
case "$PLATFORM" in
|
||||
vscode|pycharm) ;;
|
||||
*) die "--platform must be vscode or pycharm" ;;
|
||||
esac
|
||||
|
||||
scripts/adb-connect.sh --debug
|
||||
"$PY" tools/devclient.py debugger "$ACTION" --platform "$PLATFORM"
|
||||
Reference in new issue
Block a user