How to use wsa as an alternative to avd in Android Studio in wsl2

How to use wsa as an alternative to avd in Android Studio in wsl2

why I need to use wsa as an alternative to avd in Android Studio in wsl

  1. avd run fails on wsl2
  2. connect real machine to wsl2 is complicated and even expensive

Before you start

Make sure that:

  • install wsl2 android-studio and android-platform-tools
  • install wsa see how

How to perform a task

  1. start wsa and enable dev mode
  2. solve adb connect failed caused by wrong ip in wsl
    edit “C:\Users\YOU.wslconfig” ,add networkingMode=mirrored to [wsl2],you will get:
[wsl2]
networkingMode=mirrored

see why
3. connect
in wsl2 terminal run

Android/Sdk/platform-tools/adb connect 127.0.0.1:58526

the adb is installed default in ~/Android/Sdk/platform-tools/adb
4. open android-studio and it is

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值