Samsung Galaxy Z Flip7 FE USB 调试 - ADB 调试1. 开发者模式2. USB debugging (USB 调试)3. 配置 Windows 防火墙4. ADB 连接设备5. Windows 启动 adb server6. 其他主机用户连接 devices7. Troubleshooting 18. Troubleshooting 2References1. 开发者模式Settings (设置) - About phone (关于手机) - Software information (软件信息) - Build number (编译编号)连续点击Build number (编译编号)7 次进入开发者模式。2. USB debugging (USB 调试)Settings (设置) - Developer options (开发人员选项) - USB debugging (USB 调试)USB 调试 - ENABLE (连接 USB 后开启调试模式)连接 USB 时总是弹出提示 - ENABLE选择 USB 配置 - MTP (多媒体传输)3. 配置 Windows 防火墙Windows 控制面板 - 系统和安全 - Windows Defender 防火墙点击左侧 “允许应用或功能通过 Windows 防火墙”点击 “更改设置”勾选 adb 对应的 “专用” 和 “公用” 两个复选框。4. ADB 连接设备Microsoft Windows [版本 10.0.19045.6466] (c) Microsoft Corporation。保留所有权利。 C:\Users\chengadb kill-server cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: 由于目标计算机积极拒绝无法连接。 (10061) C:\Users\chengadb start-server * daemon not running; starting now at tcp:5037 * daemon started successfully C:\Users\chengadb kill-server C:\Users\chengadb start-server * daemon not running; starting now at tcp:5037 * daemon started successfully C:\Users\chengadb devices List of devices attached R5GL50ZEVVR device C:\Users\cheng C:\Users\chengadb shell b7r:/ $ exit C:\Users\chengadb devices [-l]- list connected devices (-lfor long output)列出链接的设备 (-lfor long output)C:\Users\chengadb devices -l List of devices attached R5GL50ZEVVR device product:b7rzcx model:SM_F7610 device:b7r transport_id:1 C:\Users\chengadb kill-server- kill the server if it is runningC:\Users\chengadb kill-server C:\Users\cheng C:\Users\chengadb kill-server cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: 由于目标计算机积极拒绝无法连接。 (10061) C:\Users\cheng C:\Users\chengadb devices * daemon not running; starting now at tcp:5037 * daemon started successfully List of devices attached R5GL50ZEVVR device C:\Users\cheng C:\Users\chengadb kill-server C:\Users\cheng5. Windows 启动 adb serveradb kill-serveradb -a -P 5037 nodaemon server或者adb kill-serveradb -a nodaemon server-a- listen on all network interfaces, not just localhost - 侦听所有网络接口而不仅仅是本地主机-H- name of adb server host [defaultlocalhost]-P- port of adb server [default5037]adb -a nodaemon server- 启动守护进程后其他用户可以通过adb -H 192.168.*.*** devices和adb -H 192.168.*.*** shell访问192.168.*.***挂载的手机。NOTE: Linux 和 Windows 中的 adb 版本要完全相同。Microsoft Windows [版本 10.0.19041.450] (c) 2020 Microsoft Corporation. 保留所有权利。 C:\Users\chengadb kill-server C:\Users\chengadb -a nodaemon server adb I 04-30 19:53:44 15496 12640 auth.cpp:417] adb_auth_init... adb I 04-30 19:53:44 15496 12640 auth.cpp:152] loaded new key from C:\Users\cheng\.android\adbkey with fingerprint C003CF5AD89F690A49BB31A1FB606378F31F0772F9ED77D67B67921478710B0E adb I 04-30 19:53:44 15496 10268 transport.cpp:325] FFKDU17A28006357: read thread spawning adb I 04-30 19:53:44 15496 13656 transport.cpp:297] FFKDU17A28006357: write thread spawning adb I 04-30 19:53:44 15496 12640 transport.cpp:1527] fetching keys for transport FFKDU17A28006357 adb I 04-30 19:53:44 15496 12640 auth.cpp:469] Calling send_auth_response adb I 04-30 19:53:44 15496 12640 adb.cpp:124] FFKDU17A28006357: offline对于 platform-tools_r37.0.0-win.zip 版本执行后光标闪烁但无报错说明服务‌已成功启动‌此时需‌保持该窗口开启。adb -a nodaemon server执行前先执行adb kill-server。Microsoft Windows [版本 10.0.19041.450] (c) 2020 Microsoft Corporation. 保留所有权利。 C:\Users\chengadb devices List of devices attached FFKDU17A28006357 device C:\Users\cheng C:\Users\chengadb -a nodaemon server adb F 08-29 18:13:43 14532 12896 main.cpp:153] could not install *smartsocket* listener: cannot bind to 0.0.0.0:5037: 閫氬父姣忎釜濂楁帴瀛楀湴鍧€(鍗忚/缃戠粶鍦板潃/绔彛)鍙厑璁镐娇鐢ㄤ竴娆°€?(10048) C:\Users\cheng C:\Users\chengadb kill-server C:\Users\cheng C:\Users\chengadb -a nodaemon server adb I 04-30 19:53:44 15496 12640 auth.cpp:417] adb_auth_init... adb I 04-30 19:53:44 15496 12640 auth.cpp:152] loaded new key from C:\Users\cheng\.android\adbkey with fingerprint C003CF5AD89F690A49BB31A1FB606378F31F0772F9ED77D67B67921478710B0E adb I 04-30 19:53:44 15496 10268 transport.cpp:325] FFKDU17A28006357: read thread spawning adb I 04-30 19:53:44 15496 13656 transport.cpp:297] FFKDU17A28006357: write thread spawning adb I 04-30 19:53:44 15496 12640 transport.cpp:1527] fetching keys for transport FFKDU17A28006357 adb I 04-30 19:53:44 15496 12640 auth.cpp:469] Calling send_auth_response adb I 04-30 19:53:44 15496 12640 adb.cpp:124] FFKDU17A28006357: offline6. 其他主机用户连接 devices(base) yongqiangyongqiang:~$ adb kill-server (base) yongqiangyongqiang:~$ adb -H 172.28.32.1 devices List of devices attached R5GL50ZEVVR device (base) yongqiangyongqiang:~$ adb -H 172.28.32.1 shell b7r:/ $ cd /data/local/tmp/ b7r:/data/local/tmp $ ls -l total 0 b7r:/data/local/tmp $ exit (base) yongqiangyongqiang:~$7. Troubleshooting 11.netstat -ano | findstr 5037进程 15496 占用了 5037 端口。C:\Users\chengnetstat -ano | findstr 5037 TCP 0.0.0.0:5037 0.0.0.0:0 LISTENING 15496 C:\Users\cheng2.tasklist | findstr 15496使用命令查看这个进程是由哪个程序的adb.exe创建了 15496 进程。C:\Users\chengtasklist | findstr 15496 adb.exe 15496 Console 7 10,704 K C:\Users\cheng3.taskkill /f /pid 15496结束掉 15496 进程。8. Troubleshooting 2Microsoft Windows [版本 10.0.19043.1645] (c) Microsoft Corporation。保留所有权利。 C:\Users\chengadb kill-server cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: 由于目标计算机积极拒绝无法连接。 (10061) C:\Users\chengadb -a nodaemon server adb I 05-04 17:12:43 16096 21124 auth.cpp:417] adb_auth_init... adb I 05-04 17:12:43 16096 21124 auth.cpp:152] loaded new key from C:\Users\cheng\.android\adbkey with fingerprint C003CF5AD89F690A49BB31A1FB606378F31F0772F9ED77D67B67921478710B0E如果启动 adb server 时出现上述 log请查看2. USB debugging (USB 调试)进行设置。References[1] Yongqiang Cheng (程永强), https://yongqiang.blog.csdn.net/