Have more questions? Submit a request

Android Native Device Debug

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:

  1. Go to Settings, System, About phone/tablet.
  2. Select Build number and click it 7 times.
  3. You should see a message saying You are now a developer!.
  4. Go back to Settings, System, then go to Developer options.
  5. 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.

  1. Go to Troubleshooting tab on the device page.
  2. Make sure Native Debug Enabled option is checked and click Save.

android-box-native-debug.png

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

  1. Open Chrome or other Chromium-based browser.
  2. Make sure you are connected to the device via ADB
  3. Navigate to chrome://inspect.
  4. Click inspect under your target device, WebView in io.signageos.android, file:///android_asset/www/bootloader/index.html.

android-chrome-inspect.png

Was this article helpful?
0 out of 0 found this helpful
Share