mirror of
https://github.com/google/adb-sync.git
synced 2026-01-03 09:58:01 +00:00
Make adb-channel able to start/stop a SSH server app automatically.
This commit is contained in:
@@ -4,11 +4,18 @@ set -e
|
||||
|
||||
t=`mktemp -d -t adb-channel.XXXXXX`
|
||||
|
||||
remote=${1}
|
||||
activity=${2}
|
||||
delat=${3}
|
||||
|
||||
atexit() {
|
||||
[ -z "${activity}" ] || adb shell am force-stop ${activity%%/*}
|
||||
adb forward --remove localfilesystem:"${t}/sock"
|
||||
rm -rf "${t}"
|
||||
}
|
||||
trap atexit EXIT
|
||||
|
||||
[ -z "${activity}" ] || adb shell am start -W ${activity}
|
||||
[ -z "${delay}" ] || sleep "${delay}"
|
||||
adb forward localfilesystem:"${t}/sock" "${1}"
|
||||
socat stdio unix:"${t}/sock"
|
||||
|
||||
Reference in New Issue
Block a user