Files
workphone-sdk/sdk/scripts/usb_reverse_workphone_ws.sh
Manus AI 42fe10401a 1
1
2026-05-24 17:50:04 +08:00

17 lines
595 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 调试:把手机里访问 127.0.0.1:8899 转发到「插着数据线的这台电脑」上的 8899SDK 监听端口)。
# 每次重插 USB 或 adb 重连后需重跑;可与 real_device_connect_check.sh 配合。
set -euo pipefail
PORT="${WORKPHONE_WS_PORT:-8899}"
echo "== adb reverse tcp:${PORT} tcp:${PORT} =="
adb reverse "tcp:${PORT}" "tcp:${PORT}"
echo ""
echo "== 当前 reverse 列表 =="
adb reverse --list || true
echo ""
echo "手机端 agent_config 中 server_url 建议使用 ws://127.0.0.1:${PORT}/ws/device 或带 device_id 的完整地址。"