本文介绍了如何将在 WSL2 中运行的 Android Studio 与连接的设备或在主机上运行的 android 模拟器连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 WSL 2 (Windows 10 2004) 的 Ubuntu 18.04 下运行 Android Studio(当前版本为 3.6.1),现在支持 GUI.由于 WSL2 中的虚拟化不起作用,我需要继续在主机上运行我的模拟器,当然,用于调试我的 android 应用程序的连接设备会出现在主机上.

I'm running Android Studio (currently in version 3.6.1) under Ubuntu 18.04 in WSL 2 (Windows 10 2004), which now supports GUI. Since virtualization inside WSL2 doesn't work, I need to keep running my emulator on the host and of course, connected devices which I use for debugging my android app appear on the host.

Android Studio 如何查看主机上出现的模拟器和设备?

How can Android Studio see the emulator and devices appearing on the host?

推荐答案

连接设备是有办法的,但是这个要一个一个来做:

There is a way for the connected devices, but this has to be done one by one:

  1. 在 Windows 上:adb tcpip 5555
  2. 在 wsl2 上:adb connect [ip 设备]:5555

你应该在 android studio 中看到设备

and in android studio should you see the device

这篇关于如何将在 WSL2 中运行的 Android Studio 与连接的设备或在主机上运行的 android 模拟器连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-21 01:20