Android Studio 是否有任何可能的方法 运行 Android Windows 子系统上的 Android 应用程序?

Is there any possible way to run Android apps on Windows Subsystem for Android by Android Studio?

如果我们可以在 Android 的 Windows 子系统上调试 Android 应用程序,那就太好了。

当然可以,它的工作原理类似于任何外部设备。

首先在 Windows 子系统中为 Android 设置应用程序启用开发人员模式。 Windows Subsystem for Android settings application

然后,像 adb.exe connect 127.0.0.1:58526adb.exe connect <that ip assigned to your WSA device> 一样连接 ADB 一旦连接,就照常进行。

转到 运行 -> Select 设备 Android Studio select device menu

如果 ADB 连接正确,它将在那里列为 Microsoft Corporation Subsystem for Android(TM) List of devices available to connect to in Android Studio

就是这样,它将作为外部设备的目标进行调试。 Android Studio and WSA

现在您可以从 Android Studio 和 Windows 子系统编译和调试 (Shift+F9),以便 Android 启动它并相应地暂停(断点、异常等) Debugging APK from Android Studio with WSA

Debugging APK from Android Studio with WSA

如果您想调整更多调试设置,您可以从该设置应用程序启动 WSA 中的视图。 WSA more debugging settings from within the Android instance itself