top

Command Line Interface

The Command Line Interface (CLI) provides functionalities for developing Tizen applications without the Tizen Studio. It includes the entire development process from creating the project to running the application. This topic describes the Tizen Studio CLI commands that are used differently when working with TV applications.

If you prefer a command line interface to the graphical Tizen Studio window, you can use the Command Line Interface (CLI) tool during the entire development process.

The Tizen Studio TV Extension supports all of the Tizen Studio common CLI commands, but some commands are used differently when working with TV applications.

Prerequisites

To use the Tizen Studio CLI for developing TV applications, you need:

  • Tizen Studio 1.1 or higher
  • “Web CLI” package installed from the Tizen SDK tools in Package Manager

Figure 1. Web CLI package in Package Manager

Figure 1. Web CLI package in Package Manager

  • Valid certificate profile
    If you do not have one already, create a certificate profile.
  • To allow installing your applications on the test emulator or device
    In the Tizen Studio “Connection Explorer” view, right-click the connected emulator or device and select “Permit to install applications”.
    Figure 2. Allow installing applications

    Figure 2. Allow installing applications

Installing Applications

Example:
You can install the “BasicProject.wgt” application on a TV emulator in 2 ways:

tizen install -s emulator-26101 --name BasicProject.wgt -- D:\BasicProject
tizen install -t t-1031-1 --name BasicProject.wgt -- D:\BasicProject

Options:

  • -s : Serial number of the device
  • -t : Target name

You can retrieve the serial number and target name using the sdb devices command. In the following example, the serial number of the connected device is “emulator-26101” and the target name is “t-1031-1”.

Figure 3. "sdb devices" command example

Figure 3. “sdb devices” command example

Differences from Tizen Studio common CLI:

  • Only “.wgt” files can be installed on a TV.
Note

If the application does not install properly, check that the application ID and package ID information exists in the “config.xml” file.

Figure 4. Application and package ID in "config.xml" file

Figure 4. Application and package ID in “config.xml” file

The following is the documentation for the install command in Tizen Studio common.

Figure 5. "install" command documentation

Figure 5. “install” command documentation

Running Applications

Example:
You can run the “0ifISz74ep.BasicProject” application on a TV emulator in 2 ways:

tizen run -s emulator-26101 -p 0ifISz74ep.BasicProject
tizen run -t t-1031-1 -p 0ifISz74ep.BasicProject

Options:

  • -s : Serial number of the device
  • -t : Target name

Differences from Tizen Studio common CLI:

  • To run TV applications, the -p option requires the application ID instead of the package ID.
    You can find the application ID in the “config.xml” file.
    Figure 6. Application ID in "config.xml" file

    Figure 6. Application ID in “config.xml” file

Note

The following is the documentation for the run command in Tizen Studio common.

Figure 7. "run" command documentation

Figure 7. “run” command documentation

Uninstalling Applications

Example:
You can uninstall the “0ifISz74ep.BasicProject” application from a TV emulator in 2 ways:

tizen uninstall -s emulator-26101 -p 0ifISz74ep.BasicProject
tizen uninstall -t t-1031-1 -p 0ifISz74ep.BasicProject

Options:

  • -s : Serial number of the device
  • -t : Target name

Differences from Tizen Studio common CLI:

  • To uninstall TV applications, the -p option requires the application ID instead of the package ID.
    You can find the application ID in the “config.xml” file.
Note

The following is the documentation for the uninstall command in Tizen Studio common.

Figure 8. "uninstall" command documentation

Figure 8. “uninstall” command documentation

Packaging Applications

This section describes how to use the CLI to import an existing “.wgt” file and repackage it using your own certificate.

  1. Configure the default certificate profile path.
    Use the cli-config command with the following syntax:

    tizen cli-config -g "default.profiles.path=<Your workspace directory>\.metadata\.plugins\org.tizen.common.sign\profiles.xml" 
    

    Example:

    tizen cli-config -g "default.profiles.path=C:\Users\User\my_workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
    
    Note

    The following is the documentation for the cli-config command in Tizen Studio common.

    Figure 10. "cli-config" command documentation

    Figure 10. “cli-config” command documentation

  2. Extract the content of the “.wgt” file using a compressed file management application, such as 7-Zip.

    Figure 11. Extract ".wgt" file contents

    Figure 11. Extract “.wgt” file contents

  3. In the unzipped content, delete the “author-signature.xml” and “signature1.xml” files.

    Figure 12. Delete signature files

    Figure 12. Delete signature files

  4. Rebuild the project using the build command with the following syntax:

    tizen build-web -- [Your Project Path]
    

    The build result can be found in the “<Your Project Path>/.buildResult” folder.
    Example:

    tizen build-web -- D:\CLI_TEST\BasicProject
    

    Figure 13. Project rebuilding example

    Figure 13. Project rebuilding example

    Note

    The following is the documentation for the build command in Tizen Studio common.

    Figure 14. "build" command documentation

    Figure 14. “build” command documentation

  5. Repackage the project as a “.wgt” file, using the package command with the following syntax:

     tizen package -t wgt -s [Certificate profile name] -- [Project build output path]
    
    • Certificate profile name: the security profile name.

      To find your certificate profile name, in the Tizen Studio menu, select “Tools > Certificate Manager”, and find the name of the active profile in the “Certificate Profile” panel.

      Figure 15. Certificate profile name

      Figure 15. Certificate profile name

    • Project build output path: Path to the “.buildResult” folder that was created when the project was built.

    Example:

    tizen package -t wgt -s myCert -- D:\CLI_TEST\BasicProject\.buildResult
    

    Figure 16. Project repackaging example

    Figure 16. Project repackaging example


    The packaging result can be found in the"<Your Project Path>/.buildResult" folder.
    Figure 17. Repackaged ".wgt" file

    Figure 17. Repackaged “.wgt” file

    Note

    The following is the documentation for the package command in Tizen Studio common.

    Figure 18. "package" command documentation

    Figure 18. “package” command documentation