Configuring webOS TV Extension
This article guides you on installing the webOS TV extension for Visual Studio (VS) Code. To learn how to use the critical functions of the extension, see Using webOS TV Extension.
webOS TV CLI
The extension provides the same functions as the CLI (Command Line Interface) does. Therefore, you must install the latest version of CLI and configure the CLI path in the environment variable (WEBOS_CLI_TV) before using it. The installer does the job for you.
To debug your apps using Web Inspector, you must install the compatible Chrome browser (or Chromium) with the webOS TV's Chromium browser on your PC. Some versions of the Chrome browser, however, might not work appropriately. For more information about the Chrome versions, see the link below.
Installing webOS TV Extention
To install the VS Code extension on VS Code, execute the following steps. You can also check the webOS TV extension at the Marketplace.
Run VS Code.
Bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or the View: Extensions command (Ctrl+Shift+X).
Search the 'webOS TV' extension and install it from the Marketplace.
Setting webOS TV Extention
Set the following items from File > Preferences > Settings (Ctrl+,) on VS Code. You can see the following items on the Extensions > webOS TV category.
Set the location of the Chrome browser executable to debug apps on webOS TV with Web Inspector.
Set the default device name to skip selecting a device whenever you run a command. This setting is optional.
Set the host IP address to skip entering a host IP address whenever you run the "webOS TV: Run without Installation" command. This setting is optional.
Connecting Target Device
To run or debug apps on the webOS TV device excepting the emulator, you should connect the device to your PC.
Step 1. Installing Developer Mode app
First, install the Developer Mode app on your TV and turn on Developer Mode. For more information about installing the Developer Mode app and preparing the login account, see App Testing.
Install the Developer Mode app on your TV from LG Content Store.
Launch the Developer Mode app from the webOS TV Launcher and log in to the Developer Mode with your LG account.
Click the Dev Mode Status button to turn on Developer Mode.
Step 2. Registering Target Device
Register your target device information on VS Code.
Select webOS TV: Set Up Device from the Command Palette (Ctrl+Shift+P) and select Add Device.
You can also click the Add Device icon (+) on the webOS TV Devices in the Activity Bar.
Enter your device name.
Enter your device's IP address.
Enter your device's port number for the connection. In most situations, press Enter to set it as the default value (22).
Enter the device's username for connection. In most situations, press Enter to set it as the default value (root).
Step 3. Setting SSH Key
After turning on Developer Mode on your device, launch the Developer Mode app.
Click the Key Server button in the Developer Mode app.
Select webOS TV: Set Up SSH Key from the Command Palette (Ctrl+Shift+P) on VS Code and select your device.
You can also right-click on the device and select Set Up SSH Key on the webOS TV Devices in the Activity Bar.
Enter the passphrase (case sensitive) as displayed on the Developer Mode app.