Use Windows Subsystem for Android in Windows 11 (non-US edition)

Recently, I managed to get Android working on my Windows 11 for Xamarin and MAUI development. Initially, I thought "Debugging will probably be somewhere between an emulator and an actual device", but I couldn't have been more wrong! The speed of running the application and debugging is incredible, making development on Android fun again. 😊

There is a catch for most people in the world... It's a US-only feature... But don't worry! Let an Aussie help you set up Windows Subsystem for Android without needing to be in the US in less than 10 minutes and no reboots! 😎

Ok, let's get started!

  1. Open Windows Settings (WIN + I)
  2. Search for Region Settings
  3. Under Region, change Country to United State (you can change it back later)

Screenshot-2022-03-31-091646-1

Now, we can follow existing instructions on setting up Android. 😊

A quick summary of the steps:

  1. From the Start menu, open Windows Store and install Amazon Appstore

    1. Setting up Amazon Appstore is optional.
      We only need it for the Windows Subsystem for Android (not yet standalone, as far as I know)
    2. Alternatively, you can install it from https://www.microsoft.com/en-au/p/windows-subsystem-for-android/9p3395vx91nr?amp;WT.mc_id=friends-0000-jamont&WT.mc_id=friends-0000-jamont&rtc=1&activetab=pivot:overviewtab
  2. From the Start menu, run Windows Subsystem for Android app

    1. Tick Continuous (you can work with As needed if you run at least 1 Android app when developing for Android)
    2. Enable Developer Mode
      Screenshot-2022-03-31-092815
  3. Copy IP Address (only available if Continuous or an app is running)

    1. If Copy is not availabe and have not Continuous, open a Android app
  4. Open Windows Terminal at C:\Program Files (x86)\Android\android-sdk\platform-tools:

    cd "C:\Program Files (x86)\Android\android-sdk\platform-tools"
    
  5. Run

    .\adb.exe connect [device IP from step 3]
    

    Screenshot-2022-03-31-092647

    1. If you get authentication error, you can ignore it. It will still work.
  6. Optional: You can set your region back

You'll have a new device available called Microsoft Corporation Subsystem for Android(TM) (Android 11.0 - API 30). You can use this device on any tool, like Visual Studio, that supports deployment via adb.

Screenshot-2022-03-31-094317

And that's all. 😊

You'll need to repeat steps 3 to 5 every time the Android environment restarts. The steps are pretty quick to do but I hope I'll be able to find a script to automate these steps.