Getting started developing with LG webOS

This document provides detailed instructions for installing and testing applications on LG webOS devices.

System Requirements

Systems requirements
OS Requirement
Windows Windows 10 or higher (64bit only)
macOS macOS High Sierra (10.13) or higher (64bit only)
Linux Ubuntu 20.04 or higher (64bit only)

Prerequisites

  • Node.js: Recommended versions: 14.15.1 - 16.20.2.

  • NPM: Node Package Manager.

Set Up Your Development Environment

  1. Verify the Node.js and npm installation:

    node -v
    npm -v
                        
  2. Install webOS CLI globally using npm:

    npm install -g @webos-tools/cli
    
            
  3. Verify the installation:

    ares -V
    
            
  4. Configure Environment Variables. In VsCode create a file named .zshenv with the next code:

    # Setting the LG_WEBOS_TV_SDK_HOME variable to the parent directory of CLI
    export LG_WEBOS_TV_SDK_HOME="/Users//lg_webos_cli"
    if [ -d "$LG_WEBOS_TV_SDK_HOME/CLI/bin" ]; then
    # Setting the WEBOS_CLI_TV variable to the bin directory of CLI
      export WEBOS_CLI_TV="$LG_WEBOS_TV_SDK_HOME/CLI/bin"
    # Adding the bin directory of CLI to the PATH variable
      export PATH="$PATH:$WEBOS_CLI_TV"
    fi
  5. Install and Configure VSCode Extension:
    • Download and install the webOS TV SDK extension for VSCode.

    • Restart your PC.

    • Install the Developer mode app.

    • In VSCode, click the Plus sign in the new TV icon extension to install a new device. Ensure the LG TV is in developer mode and connected to the same WiFi as your PC.

    • Select the device, set up SSH Key, and enter the passphrase shown on the STV in developer mode (Enable Key Server).

Create Your Video App

  1. Build the app by running the following command in the root directory of the SDK

    $ npx nx run-many -t build
    
    
            
  2. In your LG device, select Install Application, select the app file IPK.

  3. The app now appear below the Installed section below your your-lg-device right-click on it, select Run or Debug.

Test Your App on LG Emulator

  1. Build the app:

    $ npx nx run-many -t build
            
  2. Install the simulator.

  3. Open the LG Simulator.

  4. Click App in the controller.

  5. Find the dist directory.

  6. Once inside the directory, click open.

Common Issues

Not being able to install an app on your LG device:

  • Check the internet connection.
  • Verify the LG device is on the same network.
  • Confirm if the LG device's IP address has changed.
  • Update the LG TV's firmware.
  • Factory reset the LG TV.