[英]Use phone connected to local machine to develop on remote desktop Android Studio
I work on Windows Remote Desktop.我在 Windows 远程桌面上工作。 Local and remote OS are Windows 10. I need to access my android phone connected to my laptop via USB in Android Studio which is running on the remote desktop to build app directly on my phone.
Local and remote OS are Windows 10. I need to access my android phone connected to my laptop via USB in Android Studio which is running on the remote desktop to build app directly on my phone. My phone is visible in the Remote Desktop Connection configuration "Local devices and resources" list and is checked in, but adb doesn't see the device on the remote desktop.
我的手机在远程桌面连接配置“本地设备和资源”列表中可见并已签入,但 adb 在远程桌面上看不到该设备。 (Even the remote dekstop OS doesn't see it)
(即使是远程桌面操作系统也看不到它)
It's a bit tricky but adb have the power to connect any network-reachable device on the globe with the correct configuration.这有点棘手,但 adb 有能力以正确的配置连接全球任何可通过网络访问的设备。
No need for USB, just connect device to the local WiFi.无需USB,只需将设备连接到本地WiFi即可。
The action involves port forwarding on your home router.该操作涉及家庭路由器上的端口转发。 You need to do 2 things:
你需要做两件事:
Pairing instructions (Android 11 or above):配对说明(Android 11 或以上):
HOME_IP
.HOME_IP
。DEVICE_IP
and PAIRING_PORT
respectively.DEVICE_IP
和PAIRING_PORT
。PAIRING_PORT
, ip DEVICE_IP
.PAIRING_PORT
、 ip DEVICE_IP
。adb pair <HOME_IP>:<PAIRING_PORT>
, then enter the 6-digits code from device.adb pair <HOME_IP>:<PAIRING_PORT>
,然后从设备输入 6 位代码。 Note that step 3 is with timeout so prepare your router settings screen and remote OS's cmd before step 3.请注意,第 3 步是超时,因此请在第 3 步之前准备好您的路由器设置屏幕和远程操作系统的 cmd。
Connecting instructions:连接说明:
DEVICE_IP
and CONNECTION_PORT
respectively.DEVICE_IP
和CONNECTION_PORT
。CONNECTION_PORT
, ip DEVICE_IP
.CONNECTION_PORT
、 ip DEVICE_IP
。adb connect <HOME_IP>:<CONNECTION_PORT>
.adb connect <HOME_IP>:<CONNECTION_PORT>
。 Assuming the remote desktop is at your office - make sure your requests passes corporate firewall.假设远程桌面在您的办公室 - 确保您的请求通过公司防火墙。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.