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.
  • Make sure your PC’s region is in the US
  • 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.
Android Debugging With Windows Subsystem for Android img 1
Android Debugging With Windows Subsystem for Android image 1
  • 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.
  • But, if you are in an other region just like me, and openning the amazon appstore shows you an error message though your PC meets the requirements as shown below,
Android Debugging With Windows Subsystem for Android image 2
Android Debugging With Windows Subsystem for Android image 2
Android Debugging With Windows Subsystem for Android image 3
Android Debugging With Windows Subsystem for Android image 3
  • Open a powershell windows in admin mode at the folder where you downloaded the package. Then run this command to force install the package.
  • 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.

Configuring the Windows Subsystem for Android (WSA) in Developer mode

Before you can finally debug your android apps directly on windows, there are a few things to configure.

  • First, 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.
Windows Subsystem for Android Settings
Windows Subsystem for Android Settings

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.

  • The Ip address we copied above, we get it and run this command with ADB
  • 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 Visualstudio 2022
Targeting Windows Subsystem for Android
Targeting Windows Subsystem for Android
Targeting Windows Subsystem for Android
Targeting Windows Subsystem for Android

Conclusion

With the windows subsystem for Android, you can increase your productivity just by using it as a replacement for the Android emulator as shown above. You can also run existing Android apps. This is not yet officially released to everybody so, there will be ameliorations coming up soon. I have tested some production applications made with Xamarin, and it is not yet perfect. I had a few issues with native libraries referenced by the application. I guess these issues are due to the fact that this feature is still in the early preview phase.

Want to create a skeleton loader with Xamarin Forms? Follow this tutorial.

References

https://docs.microsoft.com/en-us/windows/android/wsa/

Follow me on social media and stay updated

Leave a Reply

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