Deploying a Web App

This article describes how to package, install and execute a web application on an emulator or webOS TV for deploying purposes.

The commands, ares-package, ares-install, ares-setup-device, and ares-launch are used to deploy web applications. See Using webOS TV CLI for the detailed description.


Packaging a Web App for Deploying

The first step is creating a package file (.ipk) for web applications. Use the ares-package command to create a package file. This command also reduces the code size before packaging.

Before executing the packaging command, you need to check the required files. An appinfo.json file must exist when packaging web application. The ares-package command will find and read appinfo.json from the web application directory. An appinfo.json file has essential fields such as main and icon. For this reason, icon image file and main page file also must exist in the correct path.

Packaging Web App

Specify a directory of the web application to be packaged when executing the ares-package command. Execute the following command to start packaging the web applications in the sampleApp directory. 

ares-package ./sampleApp

Creating package com.yourdomain.app_0.0.1_all.ipk in ./

Packaging Web App with JavaScript Service

Specify a directory of your web application first, and then specify your services using the ares-package script. Execute the following command to package your web application of sampleApp directory and your service of sampleService. 

ares-package ./sampleApp ./sampleService

Creating package com.yourdomain.app_0.0.1_all.ipk ./

To package your app and service into one ipk file, your service name must begin with the app ID. For example:

  • App ID: "
  • Service ID: ""

Now you can see that the package file exists in the directory from which you execute the command. 

The ares-package command does not support ECMAScript 6 (ES6) or later.

The command may cause an error when you minify your code written in ES6 or later. To package your app written in ES6, minify your code using external tools and execute the ares-package command with the --no-minify option.

We will fix this issue in the next SDK release.

Installing a Web App on Target Device

You need to install the created package file on a target device. Use the ares-install command to see the list of target devices before installing the web application. You can also modify the setting for the device using the ares-setup-device command.

From webOS TV 3.0, you can test your app on the actual device using Developer Mode app. For more information, see App Testing.

Listing Target Device

Use the ares-setup-device command to check the name of the device, platform type, description, and SSH access address of the target device. Execute the following command to view the list of target devices. 

ares-setup-device --list

name        deviceinfo               connection    profile
---------   --------------------     ------------  --------
emulator    developer@ ssh           tv
tv          prisoner@    ssh           tv 

The emulator is included in the default device list. Also, the ares-setup-device command shows device lists in detail with -F, --listfull option. See the following command.

ares-setup-device --listfull


ares-setup-device --listful
    "profile": "tv",
    "name": "tv",
    "deviceinfo": {
        "ip": "",
        "port": "9922",
        "user": "prisoner"
    "connection": [
    "details": {
        "platform": "starfish",
        "privatekey": "tv_webos",
        "passphrase": "ares-setup-device --full",
        "description": "new device"
    "profile": "tv",
    "name": "emulator",
    "deviceinfo": {
        "ip": "",
        "port": "6622",
        "user": "developer"
    "connection": [
    "details": {
        "platform": "starfish",
        "privatekey": "webos_emul",
        "description": "LG webOS TV Emulator"

Setting Target Device

The default loopback address needs to be changed to the remote host address if using the emulator on a remote computer for testing the web application. The following example describes how to set the host address of webOS TV emulator to the target device: 

ares-setup-device --modify emulator --info "host="

Re-check the device list to confirm if the host address of the target device has been modified.

ares-setup-device --list


name     deviceinfo                    connection  profile
-------- ----------------------------- ----------  -------

tv       prisoner@         ssh         tv

emulator developer@ ssh         tv

There is another way to change the target device's information with the interactive mode of the ares-setup-device command. The following command shows how to change a target's host address in interactive mode. Run the ares-setup-device command without any option. The ares-setup-device command will show a target device list and start interactive mode as below.


name     deviceinfo               connection  profile
-------- ------------------------ ----------  --------
tv       prisoner@    ssh         tv
emulator developer@ ssh         tv

** You can modify the device info in the above list, or add new device.
? Select
> add

If you do not want to change previous value, press the enter key without any value. For more detailed information on ares-setup-device script usage, see Using webOS TV CLI.

Installing a Web App

Execute the following command to install the package file on the target. Input the name of the target and package file as parameters.

ares-install --device emulator ./com.yourdomain.app_0.0.1_all.ipk

Installing package com.yourdomain.app_0.0.1_all.ipk

Run the target device, before you execute the ares-install command.

After installing the application, you should verify the app installation completed. Execute the following command to check the ID list of applications installed on the target. Make sure that your app ID exists in the result. 

ares-install --device emulator --list


Removing a Web App

Use the --remove option of the ares-install command to remove the application. Enter the ID of the installed application using parameters. Execute the following command to remove the application installed on the target as shown in the following example. 

ares-install --device emulator --remove

Removed application

Launching a Web App on Target Device

Use the ares-launch command to launch or close the web application installed on the target device. This section describes how to launch or close the web application.

You can launch or close a web application on Launcher UI on Emulator or real TV. And also you can use an App Manager of the target device to launch or close a web application.

Launching Web Application

Select the target device name and the application ID from the device and the application list, used during the installation phase, and enter them as parameters before executing the command as shown below:

ares-launch --device emulator

Launched application

After executing the above command, you need to check whether the sample application started on the target device or not. 

Closing Web Application

Enter the names of the target device and application using parameters to close the currently running application, just as in launching the application. 

ares-launch --device emulator --close

Closed application