It would be great if we can debug Android apps on Windows Subsystem for Android.
CodePudding user response:
Of course that is possible, it works similar to any external device.
First enable Developer mode in Windows Subsystem for Android Settings application. Windows Subsystem for Android settings application
Then, connect ADB either like adb.exe connect 127.0.0.1:58526
or adb.exe connect <that ip assigned to your WSA device>
once connect, just proceed as usual.
Go to Run -> Select Device Android Studio select device menu
If ADB had connected correctly, it will be listed there as Microsoft Corporation Subsystem for Android(TM)
List of devices available to connect to in Android Studio
And that's it, it will be available as target the external device to debug with. Android Studio and WSA
Now you can compile and Debug (Shift F9) from Android Studio and Windows Subsystem for Android launching it and pausing accordingly (breakpoints, exceptions, etc.) Debugging APK from Android Studio with WSA
Debugging APK from Android Studio with WSA
If you want to tweak more the debugging settings, you can launching its View in WSA from that Settings application. WSA more debugging settings from within the Android instance itself