SDK configuration
SourceDevelopment TV setup¶
The recommended tooling for webOS TV development is @webosose/ares-cli NPM package. It provides all the basic tools without needing to install them globally.
If your TV is rooted you must not use LG's "Developer Mode" app; installing it will probably break your system, potentially necessitating a factory reset. All of its functionality (e.g., SSH access) is replaced by Homebrew Channel.
Configuring @webosose/ares-cli with Developer Mode App¶
This is partially based on LG's instructions.
- Install Developer Mode app from Content Store
- Enable developer mode; enable keyserver
- Download TV's private key:
http://TV_IP:9991/webos_rsa
and save under$HOME/.ssh
- As with any SSH key, restrict its access rights:
chmod 600 ~/.ssh/webos_rsa
- You can test the key with:
ssh-keygen -y -P "PASSPHRASE" -f ~/.ssh/webos_rsa
- Configure the device using
ares-setup-device
(-a
may need to be replaced with-m
if device namedwebos
is already configured)PASSPHRASE
is the 6-character passphrase printed on screen in developer mode app
ares-setup-device -a webos -i "username=prisoner" -i "privatekey=webos_rsa" -i "passphrase=PASSPHRASE" -i "host=TV_IP" -i "port=9922"
Configuring @webosose/ares-cli with rooted TV¶
- Enable sshd in Homebrew Channel app
- Generate ssh key on developer machine (
ssh-keygen
) - Copy the public key (
id_rsa.pub
) to/home/root/.ssh/authorized_keys
on TV - Configure the device using
ares-setup-device
(-a
may need to be replaced with-m
if device namedwebos
is already configured)
ares-setup-device -a webos -i "username=root" -i "privatekey=id_rsa" -i "passphrase=SSH_KEY_PASSPHRASE" -i "host=TV_IP" -i "port=22"
Note: @webosose/ares-cli doesn't need to be installed globally - you can use a package installed in a local project directory by just prefixing above commands with local path, like so: node_modules/.bin/ares-setup-device ...
Configuring VS Code Extension¶
- Load https://marketplace.visualstudio.com/items?itemName=webOSOSESDK.webosose into your VSCode
- The Extension will prompt you to install needed npm Packages. This will probably fail depending on your VSCode setup due to permissions - run the commands manually in a root shell (
npm install @webosose/ares-cli
) - Setup Key auth with your TV
- run
ares-setup-device
and use your VSCode terminals ssh private key (id_rsa
) - refresh the Known Devices Tab, you should see your new TV listed.
Using SSH without SDK on unrooted devices¶
Public key fetched using the method above can be used to connect to the TV using plain SSH client:
ssh -i webos_rsa -p 9922 prisoner@TV_IP
Note: non-rooted prisoner user does not have access to PTS, and thus bash
will
behave strangely