App Testing with Developer Mode App

After you complete developing your app, you might need to test your app. The Developer Mode app provides a faster way to install, debug, and test webOS TV apps on the TV. The following introduces the concept behind the Developer Mode app that connects between the TV and the PC.

The Developer Mode app on the webOS TV connecting with a laptop

To use the Developer Mode app, the following should be ready in advance:

  • webOS TV connected to a network

  • PC connected to the same network that webOS TV is connected to and installed with the webOS CLI

  • LG Developer site account

    The Developer Mode app requires you to sign in to the LG Developer site. If you do not have an account yet, click SIGN IN on the top right corner of this page and create an account first.

Installing Developer Mode app

To install the Developer Mode app, follow the steps below:

  1. First, turn on your webOS TV and check if your webOS TV is connected to a network.
  2. Sign in with your LG Developer site account.
  3. Go to the LG Content Store.
  4. Search for "Developer Mode."
  5. Select the Developer Mode app and click the Install button.

Turning Developer Mode on

After installing the Developer Mode app, you can enable Developer Mode on your TV.

  1. Run the Developer Mode app from the webOS TV Launcher.
  2. Enter your email-based ID and password of the LG Developer site. If you do not have the account, create an account first. The sign in screenshot of the Developer Mode app
  3. Click the Dev Mode Status button to enable the Developer Mode. The TV will reboot. The screenshot of Developer Mode app
Note: Why Developer Mode is disabled?

Developer Mode is disabled:

  • After the TV reboot ten times while the TV is not connected to a network.
  • After the TV reboot when the remaining session time has run out.

After Developer Mode is disabled, the installed apps that you were using on Developer Mode are uninstalled, and you will be taken to the log-in screen of the Developer Mode app.

Connecting TV and PC

This section describes how to connect webOS TV and your PC. You can use the CLI or webOS Studio for the Developer Mode app.

Connecting with CLI

Follow the instructions below to add the target TV with the CLI:

  1. Run the webOS CLI.

  2. Execute the ares-setup-device command. Then, select add.

    ares-setup-device
    
    name     deviceinfo               connection profile
    -------- ------------------------ ---------- -------
    emulator developer@127.0.0.1:6622 ssh        tv
    
    ** You can modify the device info in the above list, or add new device.
    ? Select: (Use arrow keys)
    > add
    modify
    remove
  3. Input the information about your TV as below example:

    Note: Password Setting

    You do not need to enter the password. When using the Developer Mode app, a password is not required.

    ** You can modify the device info in the above list, or add new device.
    ? Select: add  
    ? Enter Device Name: tv2  
    ? Enter Device IP address: 10.123.45.67  
    ? Enter Device Port: 9922  
    ? Enter ssh user: prisoner  
    ? Enter description: new device
    ? Set default? Yes  
    ? Save ? Yes  
    name deviceinfo connection profile
    -------- -------------------------- ---- --
    tv2 (default)  prisoner@10.123.45.67:9922  ssh         tv
    emulator       developer@127.0.0.1:6622    ssh         tv
    myTV           prisoner@192.168.0.22:9922  ssh         tv
  4. After adding your TV as the target device, check the result with the command below:

    ares-setup-device --list
  5. Click the Key Server button in the Developer Mode app. The Key Server button on the Developer Mode app

  6. Get the key file from your webOS TV with the following command on your PC:

    ares-novacom --device tv2 --getkey
  7. A command prompt appears to enter Passphrase. Enter the exact characters (case sensitive) as displayed on your TV screen. You can see Passphrase, which consists of 6 characters, on the bottom left side of the Developer Mode app screen.

    input passphrase:
  8. Check the connection with your TV and PC with the following command:

    ares-device --system-info --device tv2

    If the connection is established successfully, the device information is displayed as below. The information might differ depending on your TV device.

    modelName : WEBOS6.0
     sdkVersion : 6.1.0
     firmwareVersion : 00.00.00
     boardType : K7LP_ATSC_KR
     otaId : HE_DTV_W21P_AFADATAA
  9. Now, you are ready to install and launch your app on your real TV. To find out how, see Install the web app and Launch the web app.

Connecting with webOS Studio

Follow the instructions below to add your TV as the target device using webOS Studio:

  1. Run VS Code and open webOS Studio installed.

  2. Select webOS: Set Up Device from the Command Palette (Ctrl+Shift+P) and select Add Device. You can also click the + button in the Known Device view.

  3. Enter your device name, IP address, port number, and user name for the connection. Enter 9922 for port number and prisoner for user name.

  4. After turning on Developer Mode on your TV device, launch the Developer Mode app.

  5. Click the Key Server button in the Developer Mode app.

  6. Select webOS TV: Set Up SSH Key from the Command Palette (Ctrl+Shift+P) on VS Code and select your device.

  7. Enter the passphrase (case sensitive) as displayed on the Developer Mode app.

  8. Refresh the KNOWN DEVICE list.

Extending Developer Mode time

Developer Mode enables for a limited time. When you turn on Developer Mode, you can check the remaining session time on the Remain Session field.

To extend the remaining time, connect the TV to a network and click the EXTEND button. If the session time runs out, you cannot extend the session time.

The Extend button on the Developer Mode app

Clearing cache data of apps

The Developer Mode app provides the Clear Cache Data feature for testing. Note that all apps' cache data is removed.

To clear cache data of all apps, follow the instructions below:

  1. Click the ON button on the Clear Cache Data field. The Clear Cache Data button on the Developer Mode app

  2. Reboot the TV.

No Headings