Home > Develop > HTML5 Application

Debug an Application

Estimated reading time: 3 minutes

This document describes how to debug an application.

Debug on BRAVIA Professional Display

BRAVIA Professional Display supports some debug features. You need to connect to your display first.

Connect to BRAVIA Professional Display

Note: For Development and Debugging on Android devices

  • Activate Android Developer Options:
    • If you want to use the Android adb command on BRAVIA Professional Display, you need to activate Android Developer Options on BRAVIA Professional Display in the same way as other Android devices. Turn the option off when not in use. In general, it should be disabled on your production environment to avoid any trouble. Please refer the details of the Android Developer Options in Android Developer Site.
  • You can use the adb command via Ethernet and Wi-Fi. The command cannot be used via USB cable.
  1. Install and set up the Android adb command on your PC.

  2. Connect to BRAVIA Professional Display with the Android adb command on your PC. The connection must be via Ethernet or Wi-Fi. USB connection is not supported.

    $ adb connect <BRAVIA Professional Display IP Address>
    

Log

BRAVIA Professional Display supports console log.

  1. Connect to your BRAVIA Professional Display in advance.
  2. Start capturing log.
    $ adb logcat -c                   # clear log buffers
    $ adb logcat -v time              # capture
    $ adb logcat -v time > log.txt    # ">" (redirect) is also available to save data.
    
  3. Stop : Control + c

Note: Logcat shows not only javascript console.log() but also other system logs.

Remote Debug

BRAVIA Professional Display supports remote debug feature. In your PC browser, you can easily debug an application running on BRAVIA Professional Display.

WebAppRuntime v1.4.10. or later

  1. connect to the display in advance. 2.
  2. specify the HTML5 app, enable remote debugging function and start WebAppRuntime.
    $ adb shell am start -a android.intent.action.VIEW -n com.sony.dtv.browser.webappruntime/.WebAppRuntimeActivity --es uri <HTML5 application url> -e args '--remote-debugging-socket-name=tvsdk-debugging-socket'
    
  3. launch the Chrome browser on your PC and type "chrome://inspect/#devices" in the address bar to display the Devices screen. 4.
  4. verify that the display model name appears under "Remote Target" in the screen. 5.
  5. Click the "inspect" button under the model name to launch a new DevTools window.

WebAppRuntime v1.3.22. or earlier

  1. Connect to your BRAVIA Professional Display in advance.
  2. Start the remote debug function on your PC.
    $ adb shell am start -a android.intent.action.VIEW -n com.sony.dtv.browser.webappruntime/.WebAppRuntimeActivity -e args '--remote-debugging-socket-name=tvsdk-debugging-socket'
    $ adb forward tcp:9222 localabstract:tvsdk-debugging-socket
    
  3. Connect to the URL http://localhost:9222 on your PC browser.
  4. You can find the debug information on your PC browser. And you can also view console log with this tool.

Cache Mode Customization

The cache mechanism is useful in many cases. However developers sometimes do not want to it in web development phase. manifest.json provides a way to disable that function.

To remove cached images and files in each page transition or reloading, the "cache_files_and_images" property should be set as false in manifest.json.

"cache_files_and_images" :

  • true : Enable to cache images and files. The default value is true.
  • false : Disable to cache images and files.
{
  "app": {
    "cache_files_and_images" : false // Disable cache mechanism
  }
}
Last modified: 4 Dec 2024