Files
workphone-sdk/sdk/scripts/phone_usb_enable_adb.sh

15 lines
440 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# USB 插线后一键开启无线 ADB5555并重连
set -euo pipefail
TARGET="${1:-192.168.110.80:5555}"
HOST="${TARGET%%:*}"
echo "等待 USB 设备授权..."
adb wait-for-device
serial="$(adb devices | awk '/\tdevice$/{print $1; exit}')"
echo "USB 设备: $serial"
adb -s "$serial" tcpip 5555
sleep 2
adb connect "$TARGET"
adb -s "$TARGET" get-state
echo "完成。可拔线auto_recover 会自动 oneclick。"