Skip to content

Instantly share code, notes, and snippets.

@Beej126
Last active November 8, 2021 03:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Beej126/4aa86ad45b1cb77a9ee922e8d53448fc to your computer and use it in GitHub Desktop.
Save Beej126/4aa86ad45b1cb77a9ee922e8d53448fc to your computer and use it in GitHub Desktop.
Windows 11 Explorer context menu to install apk into Subsystem for Android

Prerequisites

  • currently this requires at least Windows 11 insider beta channel - install guide
  • and "adb.exe" must be in your system path - install guide

Install Steps

  1. download these files to a local folder
  2. double click the android_subsys_install_apk_context_menu_setup.cmd

that's it, now you have a new context menu:

image

what to expect:

image

launch new apps from start menu (pretty slick there msft):

image

:: associate apk file extension with ProgId
reg add "HKEY_CURRENT_USER\Software\Classes\.apk" /f /ve /t REG_SZ /d WSA_APK_Install
:: progid provides the windows explorer context menu...
reg add "HKEY_CURRENT_USER\Software\Classes\WSA_APK_Install\shell\Install to Android Subsys on Windows\command" /f /ve /t REG_EXPAND_SZ /d "cmd /c clear & mode 80,15 & title WSA APK Installer & echo, & echo, & adb connect 127.0.0.1:58526 & adb install \"^%%L\" & timeout /t 5"
:: ...and file icon
reg add "HKEY_CURRENT_USER\Software\Classes\WSA_APK_Install\DefaultIcon" /f /ve /t REG_EXPAND_SZ /d "%~dp0android.ico,0"
@timeout /t 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment