Enabling native debug on Android-powered players and displays will allow you to access WebView console and capture logcat logs during development.
Setup Android Debug Bridge
First, you'll need to connect the target device to your local development machine running Android Debug Bridge (ADB).
Get Android SDK platform tools
Download latest SDK platform-tools on your development machine. Extract the archive to an easily accessible folder.
Open console in the platform-tools
folder and start ADB.
adb start-server
Enable USB Debugging
Enable Developer options and USB Debugging on the target device. On most devices this can be achieved like so:
- Go to Settings, System, About phone/tablet.
- Select Build number and click it 7 times.
- You should see a message saying You are now a developer!.
- Go back to Settings, System, then go to Developer options.
- Make sure USB debugging is turned on. Confirm the dialog if necessary.
See also the official documentation. Some devices may require a different approach in which case consult the user's manual for the device.
Connect the target device
Connect the device to your development machine using a micro USB cable.
You'll be asked to confirm USB debugging. You may check Always allow from this computer, then click OK.
Some devices have a USB A socket labeled OTG for this purpose instead. You'll need a USB A to USB A cable or an adapter.
Alternatively, if the device cannot be connected using USB it's possible it accepts ADB connections over network.
Find the device IP address in Settings, System, About phone/tablet, Status, IP address.
Run the following command on your development machine and confirm USB debugging on the device if necessary.
adb connect <IP address>
In other cases consult the user's manual for the device.
Enable Core App debugging
Enable native debug using REST API or in Box.
- Go to Troubleshooting tab on the device page.
- Make sure Native Debug Enabled option is checked and click Save.
This will allow you to access WebView console and enables additional logcat logs from Core App.
You'll need to repeat this process every time the app restarts or the device reboots.
Native Debug does not enable ADB debugging. Native Debug enables:
- Webview debug
- Export of Webview logs into logcat
You may also enable just Core App logs from ADB.
adb shell setprop log.tag.io.signageos VERBOSE
You may also enable just WebView console from ADB.
adb shell content update --uri content://io.signageos.android/debug --bind webViewDebugEnabled:b:true
Capture logcat logs
While developing you may want to capture logcat logs. To do so run the following command:
adb logcat -d -v threadtime > log.txt
Logcat logs will be saved in log.txt
on your development machine.
Access WebView console
- Open Chrome or other Chromium-based browser.
- Make sure you are connected to the device via ADB
- Navigate to
chrome://inspect
. - Click inspect under your target device, WebView in io.signageos.android,
file:///android_asset/www/bootloader/index.html
.