Home windows Subsystem for Android™️ | Microsoft Study
-
Article -
-
Home windows Subsystem for Android™️ permits your Home windows 11 gadget to run Android functions which might be out there within the Amazon Appstore. Android is a trademark of Google LLC. When you’re a developer keen on concentrating on Home windows desktop units and optimizing for the Home windows working system, this information is for you.
Vital
Microsoft is ending assist for the Home windows Subsystem for Android™️ (WSA). Consequently, the Amazon Appstore on Home windows and all functions and video games depending on WSA will not be supported starting March 5, 2025. Till then, technical assist will stay out there to prospects.
Prospects which have put in the Amazon Appstore or Android apps previous to March 5, 2024, will proceed to have entry to these apps by means of the deprecation date of March 5, 2025. Please attain out to our assist group for additional questions at support.microsoft.com.
We’re grateful for the assist of our developer neighborhood and stay dedicated to listening to suggestions as we evolve experiences.
To make your Android app out there on Home windows 11 units, you could:
For extra data or assist:
This information may also help you check and debug your Android app on Home windows:
Developer GitHub
Need to be taught extra about Home windows Subsystem for Android™️ roadmap, focus on developer points and file bugs or characteristic requests with the subsystem group? Go to the Windows Subsystem for Android™️ Developers GitHub.
Preview Program
The Home windows Subsystem for Android™️ Preview Program permits customers to obtain early-preview builds of the Home windows Subsystem for Android™ and Amazon Appstore on Home windows. For extra particulars, go to the Preview Program page.
Arrange your growth atmosphere
To check your Android app within the Home windows desktop atmosphere, a little bit of arrange will likely be required.
Stipulations
Home windows Subsystem for Android™️ is on the market on Home windows 11. Your gadget should meet particular necessities: Device requirements.
Set up the Amazon Appstore
The Microsoft Retailer will routinely set up Home windows Subsystem for Android™️ silently within the background when both of the 2 following consumer actions are taken:
- Set up the Amazon Appstore from the Microsoft Store. Deciding on Get will start the set up of the app.
- Set up an Android app from the Microsoft Retailer for the primary time, which may also set up the Amazon Appstore.
The Amazon Appstore app will then seem within the Home windows 11 Begin menu and be out there on search, providing a list of Android apps. The Home windows Subsystem for Android™️ app, which helps you to management cellular app settings and options, may also seem within the Begin menu.
Observe
The Amazon Appstore on Home windows (a requirement for working Android apps on Home windows 11) is on the market in select regions.
Home windows Subsystem for Android™️ Settings
To change Home windows Subsystem for Android™️ settings, go to: Begin > All Apps > Home windows Subsystem for Android™️. Study extra about particular settings app options: Manage settings for mobile apps on Windows.
Check and debug
To check and debug your app on a Home windows 11 gadget utilizing the Home windows Subsystem for Android™️ the next arrange steps are required.
Allow developer mode in Home windows Settings
It’s essential to first allow developer mode. Open the Windows Subsystem for Android™️ settings. As soon as open, allow Developer mode underneath Superior settings.
Hook up with the Home windows Subsystem for Android™️ for debugging
To hook up with the Home windows Subsystem for Android™️ VM for debugging:
-
Launch an Android app that was put in utilizing the Amazon Appstore.
-
You’ll be able to join utilizing adb join with the next command (you could have adb installed):
adb join 127.0.0.1:58526
Hook up with a check gadget
To hook up with a check gadget (with Home windows Subsystem for Android™️ put in) on the identical community from Home windows/Mac:
-
On the check gadget (the place Home windows Subsystem for Android™️ is put in) open a PowerShell window and establish the IP tackle of the check gadget by working the command:
ipconfig
-
Utilizing the debugging gadget terminal the place Android Studio and the Android SDK is put in (Mac/Home windows), enter the command:
adb join <TEST DEVICE IP ADDRESS>:58526
The <TEST DEVICE IP ADDRESS>
might be discovered within the output of “ipconfig” from the check gadget. It’s also possible to deploy and debug apps from Android Studio.
To make use of Android Debug Bridge (ADB) to attach your growth workstation on to your Android gadget so you possibly can set up packages and consider adjustments, see Android Debug Bridge in the Android Open Source Project docs.
Debug your app
Whereas apps must be put in utilizing the Amazon Appstore, debugging an Android app on a Home windows gadget is feasible utilizing an APK (Android utility package deal) and adb (Android Debug Bridge).
To debug an APK utilizing adb:
-
Observe the steps to connect with the Home windows Subsystem for Android™️ VM above.
-
Set up the APK utilizing the adb set up command:
adb set up app-debug.apk
Anticipated Output:
Performing Streamed Set up Success
-
A profitable “app put in” notification will seem within the Home windows notification menu and the app will launch as soon as chosen.
Constructing Common APKs
Home windows Subsystem for Android™️ makes use of Intel Bridge Know-how to allow Arm functions on x86 based mostly processors. Arm functions will run on Arm-based processors natively. The emulation layer will induce a efficiency overhead – for optimum efficiency, submit your utility for each the x86-64 and Arm64 architectures.
Enter compatibility concerns for Home windows units
There are a number of distinctive enter behaviors to contemplate that may doubtless require updates to your Android app code, designed for handheld units, to be appropriate when working on a Home windows desktop gadget through the Amazon Appstore.
Keyboard enter
For textual content enter fields dealt with by an on-screen digital keyboard enter methodology (or IME), reminiscent of EditText
, apps ought to behave as anticipated. (EditText class in the Android docs).
For keystrokes that can not be anticipated by the framework, apps might want to deal with the conduct themselves. If that is already carried out in-app, no additional work is required.
For instance, some video games could already assist motion facilitated through keyboard, by means of w
a
s
d
keys, alongside contact enter.
The next are keyboard inputs that builders ought to take into account code updates for when constructing for Home windows 11 units:
- Enter Key
- Arrow-key and Tab-key Navigation
- Change Chosen Merchandise Spotlight Coloration
- Ctrl-based Shortcuts
Study extra about find out how to optimize for these keyboard enter situations on desktop units by following the Android documentation:
Mouse enter
Builders ought to take into account updating code for the next mouse inputs when constructing for Home windows units:
- Proper Click on
- Tooltips / Hover Textual content
- Hover Results
- Mouse Scroll Wheel Motion
- Drag and Drop
Mouse enter, much like keyboard enter, should comply with the official Android app tips. This implies utilizing the InputDevice
class paired with the SOURCE_MOUSE
fixed. Study extra about find out how to optimize for these mouse enter situations on desktop units by following the Android documentation:
Window administration and resizing
In contrast to conventional cellular type elements, Android apps working on Home windows 11 might be freely resized, must be responsive of their resizing, and might be snapped utilizing Home windows actions/gestures.
Minimal display requirement
Home windows 11 enforces a minimal display requirement of 720p decision (1280×720) with a >9” display.
Letter & pillar boxing
When the side ratio of a window dimension doesn’t align between the gadget display sizes that window is being displayed on, the outcome could also be Letterboxing (the window is wider than it’s excessive, or horizontally longer) or Pillarboxing (the window is extra slender than it’s vast, or vertically longer). The result’s bars being positioned on the edges of the window so as to heart it. These bars could also be light- or dark-themed relying on the system settings chosen. This can solely happen as essential when the Android app is snapped or maximized, permitting Android apps to reap the benefits of the wealthy snapping options in Home windows and combine into the windowing mannequin.
Further resizing concerns
The next must also be thought-about when updating an Android app to run on a Home windows 11 gadget with respect to window administration and resizing:
- Preliminary launch dimension
- Window dimensions
- Content material bounds
- Free type resizing
- Display screen Orientation
Study extra about find out how to optimize for window resizing situations on desktop units by following the Window Management guide in the Android docs.
Utility Lifecycle Occasions
Growing Android functions for a multi-window atmosphere has an impression on the lifecycle occasions that you just select to make the most of in your utility. Whereas overriding the onPause
occasion could obtain the outcomes you’d like on a telephone or pill, it’s sometimes the fallacious occasion to make use of if you happen to’re altering your app’s UX.
See the Android documentation for an outline of the lifecycle occasions. Most of the time, you’ll need to use the onStop
occasion and never the onPause
or onUserLeaveHint
occasions. In truth, many multi-window Android implementations don’t ship the onUserLeaveHint
notification, and thus any enterprise vital logic that may be in that occasion handler is not going to be known as on these platforms, together with Home windows Subsystem for Android™️.
VM lifecycle concerns
Home windows Subsystem for Android™️ makes use of a digital machine (VM) which supplies compatibility with the AOSP framework and units like keyboards, mice, contact, pen, and so forth.
There are three attainable states for the VM working apps with Home windows Subsystem for Android™️:
- Working
- Light-weight Doze: Activated after no app exercise for 3 minutes. Deactivated by consumer exercise or an app notification.
- Not Working: Activated after no app exercise for 7 minutes.
Transitions between these states are triggered by consumer exercise, reminiscent of launching or interplay with the Android app or an app notification. Android apps are paused after which stopped when their window is minimized.
VM Properties
The properties for the Home windows Subsystem for Android™️ VM are listed beneath. Hardcoding these values is just not advisable as that might trigger future incompatibilities.
Property | Worth |
---|---|
Construct.MANUFACTURER | Microsoft Company |
Construct.MODEL | Subsystem for Android(TM) |
Construct.VERSION.SDK_INT | 32 |
Construct.BOARD | home windows |
Redirect to Home windows apps
Home windows Subsystem for Android™️ routinely redirects intents for information and customary URI schemes to the corresponding Home windows default file/protocol handler (if a number of intent filters match, customers see a “Home windows default app” possibility within the chooser dialog). Supported file intents embrace ACTION_VIEW, ACTION_EDIT, ACTION_SEND, and ACTION_SEND_MULTIPLE, which copy the file to the Home windows Downloads folder earlier than opening it. Supported URI intents embrace ACTION_VIEW for the http/https schemes and ACTION_VIEW and ACTION_SENDTO for the mailto scheme.
Android apps may manually redirect to Home windows apps utilizing customized URI schemes. Set the intent motion to com.microsoft.home windows.LAUNCH_URI
and add a string additional to the intent named com.microsoft.home windows.EXTRA_URI
with the customized URI as the worth. For instance, to launch the Home windows Calculator app from an Android app (Java):
Intent intent = new Intent("com.microsoft.home windows.LAUNCH_URI");
intent.putExtra("com.microsoft.home windows.EXTRA_URI", "ms-calculator:");
strive {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// Not working in Home windows Subsystem for Android™️ (or working on an older construct that didn't include this characteristic).
}
Safety
Each Home windows kernel-mode drivers and Home windows functions working at medium integrity stage (IL) can examine arbitrary Android containers and Android app reminiscence. There aren’t any plans so as to add detection for cheats/macro/bot/suspicious behaviors detection within the short-term.
Builders querying getSecurityLevel
will get SECURITY_LEVEL_SW_SECURE_CRYPTO
. Study extra about getSecurityLevel
within the Android API Reference guide.
Uninstalling Home windows Subsystem for Android™️
You’ll be able to uninstall the Home windows Subsystem for Android™️, however word that every one related apps may also be uninstalled.
- Uninstalling the Amazon Appstore will uninstall the Home windows Subsystem for Android™️ and all different Android apps.
- Uninstalling an Amazon Appstore app will solely uninstall the app (identical conduct as Home windows apps).
- Uninstalling the Home windows Subsystem for Android™️ will uninstall the Amazon Appstore and all Android apps.
Troubleshooting points
When you encounter points particular to the Amazon Appstore on Home windows, strive the next troubleshooting steps:
- Choose Home windows search from the Home windows job bar.
- Seek for “Amazon Appstore” and right-click on the Amazon Appstore icon.
- Choose “App Settings” within the dropdown choices.
- Choose “Storage and Cache” and click on each “Clear Storage” and “Clear cache”.
- Return and choose “Drive Cease”.
- Shut the Amazon Appstore Settings window.
- Relaunch the Amazon Appstore.
For additional troubleshooting steps regarding the Home windows Subsystem for Android™️ Settings app or to depart suggestions utilizing Suggestions Hub, see Troubleshooting and FAQ for mobile apps on Windows.
For another developer questions and assist, use the Windows Subsystem for Android™️ tag on Microsoft Q&A.