Android Debugging
Debugging an android WebView in Chrome
(On physical devices only, not needed for simulator)
Enable Developer Options: On your Android device, open the "Settings" app, navigate to "About phone", and tap on "Build number" seven times. This will enable developer options on your device.
Connect your device for debugging:
2a. USB: Connect your Android device to your computer using a USB cable. Make sure that USB debugging is enabled in the developer options. You may need to authorize your computer to connect to the device.
2b. Wireless: If you want to connect your device over Wi-Fi, you need to enable wireless debugging in the developer options. Here you will also find the IP address and port for your device, followed by a pairing code. You can use this with adb to connect to your device wirelessly.
adb pair device-ip-address:port pairing-code![NOTE] See adb debugging on how to use adb
- Inspect the WebView: Open a new tab in Chrome and enter the following address:
chrome://inspect/#devicesThis page lists all the devices connected to your computer. Under the "WebView" section, you should see your device listed with the app that contains the WebView.
Inspect WebView contents: Click the "Inspect" button next to the WebView you want to debug. A new Chrome DevTools window will open, displaying the WebView's contents.
Use Chrome DevTools: In the DevTools window, you can use various tabs such as "Elements", "Console", "Network", and "Application" to inspect and debug the WebView.
Import an APK into Android Studio for debugging
Open Android Studio: Launch Android Studio on your computer.
Access the Profile APK Importer: In Android Studio, go to the top menu and select "Profile or Debug APK".
Select the APK to import: In the file browser, select the APK file you want to import and click "OK".
Run the APK: Android Studio will import the APK and you can now run it on a connected device or emulator. You can now use Android Studio's debugging tools to debug the APK.
Installing/pushing apps via adb
To test built apps on an emulated or real Android device, you can point the device's browser at https://$install.kdevel.co.uk/downloadlist and download the app from there.
Or, more conveniently for emulated devices or real devices hooked up via USB with debugging enabled, just adb install directly.
$ adb install W-20201019214304-test.apkAlternatively, you can profile or debug APK in Android Studio. This will also let you debug the app in a emulated device.