What will this article talk about?

A lot of my friends are trying to run Android apps on Windows 11. Looks like Microsoft's demo is pretty cool. But soon we found out that Microsoft only promised to run apps from the Amazon app store. And the apps in the Amazon app store are very scarce.

We are very much looking forward to being able to run custom Apks. Or even go a step further, install apps directly from Google Play.

You need to:

  • Prepare the Windows devices to get ready for Android subsystem.
  • Enable Android subsystem via downloading the Amazon App Store.
  • Use adb to connect and manage your Android subsystem.
  • Learn to deploy a custom .apk file
  • Learn to manage and uninstall a custom Android package.
  • Learn to install Google Play.
  • Fix Internet connection.

Prepare

Before getting started, you need to make sure your computer supports virtualization.

file

You MUST enable Hyper-V featurs.

You can do that via opening Windows Features. Or running PowerShell:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart
Write-Host "Enabled!"

file

And make sure you have adb installed ready. You can download adb here:

https://dl.google.com/android/repository/platform-tools-latest-windows.zip

After downloading, add the unzipped folder to environment variables. Make sure adb runs locally.

file

Enable

Now go to Microsoft app store. Enable WSA now. You can search Amazon and result will be shown.

file

Install that Amazon app store. While installing, Windows 11 will enable WSA feature, and may reboot.

(This WSA distribute does NOT support Google Play services. You can skip this step if you need Google Play)

After installing, you can see Windows subsystem for Android settings in your start menu.

file

Connect and manage

Make sure the subsystem is started by clicking the Amazon app store or any Android apps.

Enable the developer mode for your subsystem in the settings app:

file

Now you can use adb to connect to the subsystem.

$ adb connect 127.0.0.1:58526

file

And you can open Android native settings app via running:

$ adb shell am start -n com.android.settings/.Settings\$WifiSettingsActivity

You may try this if that is not working:

adb shell am start -a com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS

file

Deploy an apk

Now you can download an Android application apk. For example, you can download bilibili at: https://app.bilibili.com/

file

And you can start deployment via:

$ adb install ./iBiliPlayer-bili.apk

file

Uninstall an apk

You can run the following command to list all installed packages:

$ adb shell pm list packages

And to uninstall, it's easy. Find the package name first, and then run:

$ adb uninstall 'package.name'

file

For system apps, you may need this command to uninstall:

# Dangerous to run
$ adb shell pm uninstall -k --user 0 package name

Install WSA with Google Play

You might be tempted to run Youtube, games or Microsoft Authenticator. But these apps all crash because they are missing the Google Services Framework.

(It seems you don't have to install the Amazon AppStore before installing the community distrib MagiskOnWSA.)

Installing them isn't difficult either.

First go to:

https://github.com/LSPosed/MagiskOnWSA

And click fork:

file

After forking, you can run the workflow to build your own image.

file

I personally suggest building with full apps options. As pico may have some issue like couldn't connect to the internet.

file

After building, you just need to download the build artifact:

file

And run the install.ps1:

file

After running, you may see:

file

And Google Play will start working.

file

file

And enjoy!

file

file

Fix Internet connection

When I first deployed Android Subsystem, I found that it couldn't connect to the Internet. So I spent some time debugging it.

file

Open the Wifi settings in Android first:

Run the following command:

adb shell am start -n com.android.settings/.Settings\$WifiSettingsActivity

KEEP that app open! Or you won't have a chance to open that again.

file

And, go to Hyper-V Manager. We gonna switch the network adaptor.

file

Go to virtual switch manager.

file

You may see that there is an virtual switch named: WSL.

Change that to External Network. Select the physical network card which has access to Internet.

file

After switching, your main Windows 11 OS may share the same switch with your WSA. We switched that from NAT mode to share the same network with main OS.

And you need to know the WSA's IP address.

Click the settings of the VirtWifi:

file

file

And change that to DHCP.

file

And now it will be shown as connected.

file

Copy it's IP address soon!

file

And don't forget to reconnect to that with adb:

file

Now enjoy!

file