Learn how to debug your Smart TV applications using free tools available in the web like weinre! the best way to debug Smart TV applications for the Samsung Orsay platform.
DISCLAIMER: This tutorial is for those who are still developing on the current SmartTV platform (codename Orsay).
- Download node.js, if you already have it in your machine skip this step.
- To globally install weinre, type the next commands in your terminal or command line:
npm -g install weinre
- Just type in your command line or terminal:
- Weinre will start a server at http://localhost:8080
- Open a browser and go to http://localhost:8080
To stop the server you can always use Ctrl+c in the Command Line.
Running from a specific address
It is recommended though that you specifically tell weinre your local ip address (my local ip address is 18.104.22.168 so I will use that).
- To achieve this add the parameter boundHost when executing weinre:
weinre --boundHost 22.214.171.124
- Weinre will start a server at http://126.96.36.199:8080
- Open a browser and go to http://188.8.131.52:8080
If you have port 8080 blocked
Alternatively if you have the port 8080 blocked you may use a different one:
- Type in the the weirne command along with the http port you want to use, example:
weinre --boundHost 184.108.40.206 -httpPort 8086
- Weinre will start the server. In this case at http://220.127.116.11:8086
- Open a browser and go to http://18.104.22.168:8086
Ultimately, when you open your browser you should see something like this:
Your weinre server is alive!
Now we just need to tell our app to comunicate to our server. We will copy the <script> tag in the Target Script section.
I will paste it in the index.html of my app:
<!DOCTYPE html> <html> <head> <script src="http://localhost:8080/target/target-script-min.js#anonymous"></script> </head> <body> <h1>Hello! anyone there?</h1> </body> </html>
Now load your app either from a web-browser, the SmartTV emulator or a TV itself, your app will make a request to your local server so it can load the target-script-min.js file. You may open any number of instances in any number of devices you wish. I opened 3 browser instances that had the target script, go to the Access Point section to visualize a list of the current targets (select one of them):
Go to the Elements tab to inspect markup in your app:
Go to the Console tab to receive log information from your app or type in commands to test that everything is working:
And thats it! Now you should be able to debug your SmartTV (Orsay) apps on remote devices. Way better than just blindly loading and testing your app into a device.