来源:紫鸟帮助中心/博客/主站资讯 + HubStudio API 文档/帮助中心 + 三个官方 skill 仓库。 只入库 Markdown 与元数据;原始 HTML 与 tarball 留在本机。
2.9 KiB
2.9 KiB
HubStudio ADB Connection Skill
This guide standardizes ADB connection workflows for HubStudio cloud phones.
Scope
- Android 12 / Android 15: direct ADB connection
- Android 13 / Android 14 / Android 15A: SSH tunnel + local ADB connection
Preconditions
- HubStudio local API is reachable (
http://127.0.0.1:6873) - Cloud phone is powered on
- ADB access is enabled
- Local
adbcommand is installed and available in PATH
If ADB is not installed
macOS (Homebrew):
brew install android-platform-tools
adb version
Windows (winget):
winget install Google.PlatformTools
adb version
Manual install (all platforms):
- Download Android SDK Platform Tools from Google
- Add
platform-toolsdirectory to PATH - Re-open terminal and run
adb version
Step 0: Enable ADB and Query Connection Info
- Enable ADB:
node hubstudio.js adbEnable <mobileId>
- Query ADB info:
node hubstudio.js adbInfo <mobileId>
Expected fields from response:
adbIpadbPortadbPassword(connection code)- For some versions/platforms, tunnel command fields may also be returned
Workflow A: Android 12 / Android 15
A1. Connect directly to cloud phone
adb connect <adbIp>:<adbPort>
A2. Authenticate with connection code
adb shell <adbPassword>
or:
adb -s <adbIp>:<adbPort> shell <adbPassword>
A3. Verify connection
adb devices
Workflow B: Android 13 / Android 14 / Android 15A
B1. Create SSH tunnel (first terminal)
ssh -oHostKeyAlgorithms=+ssh-rsa <sshUser>@<sshHost> -p <sshPort> -L <localPort>:adb-proxy:<remoteAdbPort> -Nf
When prompted, input the SSH password from platform response.
B2. Connect local forwarded ADB port (second terminal)
adb connect localhost:<localPort>
B3. Verify connection
adb devices
Expected output:
List of devices attached
localhost:<localPort> device
Complete Operation Checklist
- Cloud phone is powered on
enableAdb=trueapplied successfullylist-adbreturns non-null ADB fields- Chosen proper workflow by Android version
adb devicesshows connected device
Common Commands
adb devices
adb shell
adb shell pm list packages
adb install app.apk
adb uninstall <package.name>
adb reboot
Troubleshooting
adb connect timeout or refused
- Confirm cloud phone status is running
- Confirm ADB is enabled
- Re-query
list-adbto ensureadbIp/adbPortis valid - Check local firewall/network policy
SSH tunnel mode cannot connect
- Verify tunnel process is alive
- Confirm
<localPort>is not occupied - Rebuild SSH tunnel and retry
adb connect localhost:<localPort>
Connected but shell auth fails
- Recheck
adbPasswordfrom latestlist-adbresponse - Retry on specific device with
adb -s ... shell <code>