Samsung SmartTV DevTool — WITs

Sulhadin Öney
blutv
Published in
3 min readOct 5, 2021

WITs is a tool that can speed up and improve the development of your Tizen web application. If you use WITs to test your app on TV, you don’t have to package and install the app every time you change the code. In other words, WITs enables you to see the instant change in your Javascript, HTML and CSS code on SmartTV.

WITs instantly updates and reloads your app on your TV. It is an open source library and also uses NodeJS and SDB.

Prerequisites

Terminologies

  • Device (Your SmartTV)
  • Host (The computer you want to connect to the TV)

Install WITs

$ npm install -g @tizentv/wits

In order to deploy your application on your Samsung SmartTV, developer mode should be switched to ON.

Switch Developer Mode: ON

From your remote controller press Home, open Smart Hub and navigate to “Apps

Enter “12345” in the “Apps” field using the remote control or the numeric keypad on the screen. The developer mode setup pop-up appears.

  • After developer mode opens switch developer mode to ON
  • Enter the IP address of the “Host” and click OK.
  • Restart your TV. You can turn the tv off by holding the power button for 2 seconds.

Final steps

You need to create two files before run your application; .witsconfig.json and profiles.xml

Certification

Run the code below to create your certification.

$ wits -c 

Note: No need to run everytime deploy your application.

After you generate a certification, you can copy the path of profiles.xml because you are going to need it later.

Then, run the following command to config your profile path.

$ wits -i

After it is done, that command will generate a .witscommand.json

// .witscommand.json
{
“connectionInfo”: {
“deviceIp”: “192.168.0.0”,
“hostIp”: “192.168.1.71”,
“socketPort”: 4767,
“width”: “1920”,
“isDebugMode”: true
},
“profileInfo”: {
“path”: “{path to certificate}/profiles.xml”
}
}

You should move this file in your application’s folder.

/www
-- index.html
-- .witscommand.json
-- .witsignore

After all your configurations are done, run;

# Run wits --start
$ wits -s

Possible Issues

1-

Issue

wits -s 
....
connect to....192.168.1.30
Failed to connect 192.168.1.30

Possible Solutions

  • You are not on the same network as the device or the ip address is different.
  • You can edit the IP address at .witsconfig.json.

2-

Issue

============================== Start to install the package Failed to buildPackage: 
Error: Command failed: /Users/tizentv-tools/sdb/sdb -s undefined shell 0 vd_appuninstall BluTVWITs
error: target not found 5error: serial number 'undefined' wrong

Possible Solutions

  • The device has entered sleep mode and restarted. In Samsung, this type of error can be received when TVs enter sleep mode.
  • You can restart the TV
  • From the Samsung Apps screen, press the 1 2 3 4 5 buttons to open the Developer Mode dialog from the remote control. If it doesn’t open, try again. If the Developer Mode dialog opens, check the IP address. You need to make sure it matches the IP of HOST

AN IMPORTANT NOTE: WITs is compatible with Samsung Smart TVs 2017 and later.

SmartTV world evolves and there is a huge work to do in this area. WITs is a perfect devtool for Samsung SmartTV developers. For other SmartTVs there is an alternative devtool called vorlonjs (http://www.vorlonjs.io). It is a bit challenging but works fine.

--

--