Android debugging with Windows Subsystem

Windows Subsystem for Android

In this new exciting post, I show you how to install Windows Subsystem for Android and debugging a new MAUI app with Android debugging with Windows Subsystem (outside US version) If you are in the US, you are allowed to download the Windows Subsystem from the Microsoft Store. No emulator required!

A few days ago, Microsoft announced that the Windows 11 OS will run Android apps natively with its subsystem for Android, and this got several tech communities online excited. I was definitely excited too when I thought about dumping my android emulator for good. Seriously, in my opinion, this one feature is a game-changer.

At the time of writing this article, this feature was only available for US citizens. I’m not in the US, I’m in Europe but I could run this feature and test it. If you are not in the US too, or if you read this in the future, and you want to do android debugging with windows subsystem for Android, this article is for you.

Installing Windows Subsystem for Android

To install Windows Subsystem for android, make sure that you subscribe to the windows insider’s update beta channel.

Then, you should update your windows 11 OS to a build equal to or greater than “Windows 11 Build 22000.xxx series“. Check these requirements (Under the “Feature-specific requirements” heading) to run the Windows Subsystem for Android, and make sure your PC meets these requirements.

One important condition is your PC’s region must be in the US.

In some cases, it is required to turn on Virtualization on your PC. Do this by searching for “Windows Features” in the start menu. The image below shows you what you should check.

Turn Windows features on or off - Android debugging with Windows Subsystem
Turn Windows features on or off

If you are in the US and your PC meets the requirements, you can go directly to the Microsoft store and download the Amazon Appstore. This will lead to the installation of the Windows Subsystem for Android automatically.

If you are in another region and opening the Amazon Appstore shows you an error message though your PC meets the requirements as shown below.

Amazon Appstore on Microsoft Store for Windows 11 - Android debugging with Windows Subsystem
Amazon Appstore on Microsoft Store for Windows 11

If you are not in the US…

Follow this link to see the Windows Subsystem for Android in the Microsoft store. Copy the link of the windows subsystem for android we just opened above, and paste it in the text entry you will find here.

Using RG-Adguard.net to download the installer
Using RG-Adguard.net to download the installer

Now, from this list of packages you have to download the one with name MicrosoftCorporationII.WindowsSubsystemForAndroid_1.8.32828.0_neutral_~_8wekyb3d8bbwe.msixbundle

Open a PowerShell Windows in Admin mode at the folder where you downloaded the package. Then run this command to force install the package.

add-appxpackage .\MicrosoftCorporationII.WindowsSubsystemForAndroid_1.7.32815.0_neutral___8wekyb3d8bbwe.Msixbundle

Once this step succeeds, you’ll be able to find the windows subsystem for android app in the start menu. If you restart your PC, you’ll also be able to download the Amazon Appstore.

Windows Subsystem for Android is installed
Windows Subsystem for Android is installed

Configure Windows Subsystem for Android

So, at this point you should find your Windows Subsystem for Android (WSA) on your app list. If not, restart your computer. Then, open the app and toggle developer mode on the WSA settings. You can also toggle “Continuous” stating the subsystem is always running. Then, refresh your IP address and copy it. The IP takes a while to be assign. Be patient and refresh.

Debugging Your Android App Directly on Windows (No Emulator)

This is the final step, and it is dead simple. We need to connect our Android instance to ADB. This is just like connecting a real Android device to your PC over WIFI. You’ll be able to target it in your IDE as any other device.

So, open Visual Studio and open an Android Adb Command Prompt.

Android Adb Command Prompt in Visual Studio 2022
Android Adb Command Prompt in Visual Studio 2022

The Ip address we copied above, we get it and run this command with ADB

adb connect 172.23.214.190

Go into your IDE, open your project, and target the Subsystem for Android to deploy your app. In our case, we do so with a MAUI app on Visual Studio 2022.

Visual Studio 2022 recognizes Windows Subsystem for Android
Visual Studio 2022 recognizes Windows Subsystem for Android

So, now I can try to run a new MAUI application to the Windows Subsystem for Android. Will see…

MAUI application is running in Windows Subsystem for Android
MAUI application is running in Windows Subsystem for Android

Wonderful! With Visual Studio I can perform an Android debugging with Windows Subsystem! The beauty of that? This is my first MAUI application with Visual Studio 2022 (Preview) runs an Android app! I’m so excited!

Happy coding!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.