如何将在WSL2中运行的Android Studio与连接的设备或主机上运行的android仿真器连接 [英] How to connect Android Studio running inside WSL2 with connected devices or android emulator running on host

查看:233
本文介绍了如何将在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连接[ip设备]:5555

在Android Studio中,您是否应该看到该设备

and in android studio should you see the device

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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆