/ Windows11

Use Windows Subsystem for Android in Visual Studio

This blog post is to summarize what you should do to run Windows Subsystem for Android in Visual Studio. If you need instructions on how to enable Windows Subsystem for Android in Windows 11, follow Windows Subsystem for Android in Windows 11.

  1. From the Start menu, run Windows Subsystem for Android app

    1. Under Developer, Enable Developer Mode (optionally enable automation dev)
      win11-android-dev
  2. Keep Developer settings open and open Windows Terminal and run:

    cd "C:\Program Files (x86)\Android\android-sdk\platform-tools"
    adb.exe connect [device IP from step 3]
    

    NOTE: It's .\adb.exe if in PowerShell.
    win11-android-start-dev

  3. In Visual Studio switch to Microsoft Corporation Subsystem for Androind(TM) (Android X.Y - API XX)
    win11-android-vs

TIP: The IP usually is 127.0.0.1:58526 and you can try to run adb.exe connect 127.0.0.1:58526 straight away to see if it works.

NOTE: If you don't see IP, make sure Android subsystem is running. (if in step 2.1 you selected "As needed", you need to run at least 1 Android app)
NOTE: If you get authentication error, you can ignore it. It will still work.