Mobile native Wearable native

Command Line Interface

The native CLI (command line interface) provides the functional tools for developing Tizen native applications without the Tizen IDE. It includes the entire developing process from creating to running and debugging the project. The CLI is located in the $<TIZEN_SDK_HOME>/tools/ide/bin directory. For developing an application using the CLI, add the CLI directory path to $PATH using the following command:

export PATH=$PATH:$<TIZEN_SDK_HOME>/tools/ide/bin

The CLI in the IDE provides functional commands for:

Note
To use the CLI, you need the Java Runtime Environment version 6 or higher.

The following tables list the available CLI commands.

tizen cli-config

Displays, sets, replaces, and removes CLI settings.

The key and the name are separated by an equal sign.

The CLI configuration keys are:

  • default.build.architecture=<x86|arm>

    Sets the default executable architecture type: x86 or arm.

  • default.build.compiler=<llvm|gcc>

    Sets the default compiler. The default is llvm.

  • default.build.configuration=<Debug|Release>

    Sets the default build configuration. The default is the debug mode.

  • default.profiles.path=<path of profile.xml>

    Sets the path to the profile.xml file.

  • default.sdb.timeout=<timeout value>

    Sets the default connection timeout value. The default is 60000 milliseconds.

Syntax:

      tizen cli-config [-g <key>=<value>]
      tizen cli-config -l
    

    Options:

    • -g <key>=<value>, --global <key>=<value>:

      Sets the CLI configuration key and value you want to assign as global.

    • -l, --list:

      Displays the list of all CLI configuration keys and values.

    Examples:

    • Sets a profile.xml path globally:

        $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
      

      Or for Windows:

        > tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
      
    • Displays the list of all configurations for which values are set:

        $ tizen cli-config –l
        default.build.architecture=x86
        default.build.compiler=llvm
        default.build.configuration=Debug
        default.profiles.path=/home/mustafa/workspace/0904/.metadata/.plugins/org.tizen.common.sign/profiles.xml
        default.sdb.timeout=60000
      
    tizen list

    Displays the profile templates in a list corresponding to the given sub-command.

    Syntax:

        tizen list native-project
      

      Examples:

      • Lists all templates:

          $ tizen list native-project
             [PROFILE]           [TEMPLATE]
             mobile-2.3           service_app
             mobile-2.3           static_library
             mobile-2.3           basic_edc_ui
             mobile-2.3           shared_library
             mobile-2.3           basic_ui
             wearable-2.3         service_app
             wearable-2.3         static_library
             wearable-2.3         shared_library
             wearable-2.3         basic_ui
             wearable-2.3         basic_edc_ui
        
      tizen create

      Creates a Tizen native project.

      Syntax:

          tizen create native-project [-p <profile name>] [-t <predefined template>] 
                                      [-n <project name>] [-- <project location>]
        

        Options:

        • -p, --profile:

          Specifies the profile name.

        • -t, --template:

          Specifies the template name.

        • -n, --name:

          Specifies the project name.

        • --:

          Specifies the destination directory where the project is created.

        Examples:

        • Creates the template project based on the basic Tizen mobile UI project:

            $ tizen create native-project –p mobile-2.3 –t basic_ui –n basic -- /home/workspace
            $ cd /home/workspace/basic
          

          Or for Windows:

            > tizen.bat create native-project –p mobile-2.3 –t basic_ui –n basic -- C:\Users\workspace
            > cd C:\Users\workspace\basic
          
        tizen build-native

        Builds the Tizen native project with the default values (if you do not set the options).

        There are 3 options: architecture, compiler, and configuration. All options are required and the default values are described in the CLI configuration file.

        Syntax:

            tizen build-native [-a {x86|arm}] [-c {gcc|llvm}] 
                               [-C {Debug|Release}] [--]
          

          Options:

          • -a, --arch:

            Specifies the architecture type.

          • -c, --compiler:

            Specifies the compiler. You can use this option with the following compiler versions: gcc-4.9 and llvm-3.6

          • -C, --configuration:

            Specifies the build configuration.

          • --:

            Specifies the project directory.

          Examples:

          • Builds the project with the llvm compiler and the debug mode. The x86 executable named basic is generated, if the project is built successfully:

              $ tizen build-native -–arch x86 –-compiler llvm –-configuration Debug -- /home/workspace/basic
              $ ls /home/workspace/basic/Debug/
            

            Or for Windows:

              > tizen.bat build-native -–arch x86 –-compiler llvm –-configuration Debug -- C:\Users\workspace\basic
              > dir C:\Users\workspace\basic\Debug
            
          • Builds the project with the default options:

              $ tizen cli-config –l
              default.build.architecture=x86
              default.build.compiler=llvm
              default.build.configuration=Debug
              $ tizen build-native -- /home/workspace/basic
              $ ls /home/workspace/basic/Debug/
            

            Or for Windows:

              > tizen.bat build-native -- C:\Users\workspace\basic
              > dir C:\Users\workspace\basic\Debug
            
          tizen clean

          Cleans the Tizen native project.

          Syntax:

              tizen clean [--]
            

            Examples:

            • Cleans the project:

                $ tizen clean -- /home/workspace/basic
              

              Or for Windows:

                > tizen.bat clean -- C:\Users\workspace\basic
              
            tizen certificate

            Generates a Tizen certificate for your application.

            If you want to upload your application to the Tizen store or install the application to a Tizen device, you must generate a Tizen certificate.

            Syntax:

                tizen certificate [-a <alias name>] [-p <password>] [-c <country name>]
                                  [-s <state>] [-ct <city>] [-o <organization>]
                                  [-u <organization unit>] [-n <user name>] [-e <email>]
                                  [-f <file name>] [--]
              

              Options:

              • -a, --alias:

                Specifies an alias name of the certificate.

              • -p, --password:

                Specifies the key password of the user account.

              • -c, --country:

                Specifies the user's country code which consists of 2 letters.

              • -s, --state:

                Specifies the user's state.

              • -ct, --city:

                Specifies the user's city.

              • -o, --organization:

                Specifies the user's organization.

              • -u, --unit:

                Specifies the user's organization unit.

              • -n, --name:

                Specifies the user's name.

              • -e, --email:

                Specifies the user's email.

              • -f, --filename:

                Specifies the file name without a file extension. A certificate file is created with the file name.

                If you skip this option, the default file name, author, is used on creating the certificate file.

              • --:

                Specifies the output directory path.

                If you skip this option, the default output directory path, <TIZEN_SDK_DATA>/keystore/author/, is used on saving the certificate file.

              Examples:

              • Generates a certificate:

                  $ tizen certificate -a MyTizen -p 1234 -c KR -s Seoul -ct Gangnamgu -o Tizen -u Development -n "Gildong Hong" -e gildonghong@example.org -f mycert
                  Generating a certificate with
                    File name = mycert
                    Container Password = ****
                    Alias = MyTizen
                    Key Password = ****
                    Country = KR
                    State = Seoul
                    City = Gangnamgu
                    Name = Gildong Hong
                    Organization = Tizen
                    Organization Unit = Develop
                    E-mail = gildonghong@example.org
                  'mycert' has been generated in '~/tizen-sdk-data/keystore/author'.
                
                  $ ls ~/tizen-sdk-data/keystore/author
                  mycert.p12
                

                Or for Windows:

                  > tizen.bat certificate -a MyTizen -p 1234 -c KR -s Seoul -ct Gangnamgu -o Tizen -u Development -n "Gildong Hong" -e gildonghong@example.org -f mycert
                
              tizen security-profiles

              Manages the security profiles, which are a set of signing certificates for a Tizen application. The following commands are supported:

              • add: Adds the specified security profile which can contain several certificates.

              • list: Displays security profiles. If you specify the name of the security profile, the detailed information of the specified security profile is displayed.

              • remove: Removes the specified security profile.

              Syntax:

                  tizen security-profiles add [-n <security profile name>]
                                              [-a <author certificate path>]
                                              [-p <author password>]
                                              [-c <author CA certificate path>]
                                              [-r <author root CA certificate path>]
                                              [[-d <distributor1 certificate path>][...]]
                                              [[-dp <distributor1 password>][...]]
                                              [[-dc <distributor1 CA certificate path>][...]]
                                              [[-dr <distributor1 root CA certificate path>][...]]
                                              [--]
                
                  tizen security-profiles list [-n <security profile name>] [--]
                  tizen security-profiles remove [-n <security profile name>] [--]

                Options:

                • -n, --name:

                  Specifies the name of the security profile to add, remove, or display.

                  When you enter tizen security-profiles list without a name argument, a set of the security profile names in the profiles.xml file is displayed.

                • -a, --path:

                  Specifies the directory path where the author certificate file is located. The format of the certificate is PKCS#12, and the file extension is .p12.

                • -p, --password:

                  Specifies the password used to access the author certificate.

                • -c, --ca:

                  Specifies the directory path where the author CA certificate file is located. The file extension of the CA certificate is .cer.

                • -r, --rootca:

                  Specifies the directory path where the author Root CA certificate file is located. The file extension of the Root CA certificate is .cer.

                • -d, --dist:

                  Specifies the directory path where the distributor certificate file is located.

                  If you skip this option, the default distributor certificate file embedded in the Tizen SDK is used.

                • -dp, --dist-password:

                  Specifies the password of the distributor certificate.

                • -dc, --dist-ca:

                  Specifies the directory path where the distributor CA certificate file is located.

                • -dr, --dist-rootca:

                  Specifies the directory path where the distributor Root CA certificate file is located.

                • --:

                  Specifies the directory path where profiles.xml is located.

                  If you skip this option, the value of the default.profiles.path key in the CLI configuration is used to find the profiles.xml file, which consists of new security profiles that are generated in <TIZEN_SDK_DATA>/keystore/. The directory path is added to the CLI configuration.

                Examples:

                • Adds a new security profile:

                    $ tizen security-profiles add -n MyProfile -a ~/tizen-sdk-data/keystore/author/mycert.p12 -p 1234
                    No exist the default path of security profiles.
                    author path: ~/tizen-sdk-data/keystore/author/mycert.p12
                    author password: ****
                    distributor1 path: ~/tizen-sdk/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.p12
                    distributor1 password: *************************
                    distributor1 CA path: ~/tizen-sdk/tools/certificate-generator/certificates/distributor/tizen-distributor-ca.cer
                  
                    In Configuration, Set a default profile path to '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    Wrote to '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    Succeed to add 'MyProfile' profile.
                  

                  Or for Windows:

                    > tizen.bat security-profiles add -n MyProfile -a C:\tizen-sdk-data\keystore\author\mycert.p12 -p 1234
                  
                • Displays the security profiles:

                    $ tizen security-profiles list
                    Loaded in '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    ========================================
                    Name
                    ========================================
                    MyProfile
                  
                    $ tizen security-profiles list -n MyProfile
                    Loaded in '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    ========================================
                    'MyProfile' profile information
                    ========================================
                    author path: ~/tizen-sdk-data/keystore/author/mycert.p12
                    author password: ****
                    distributor1 path: ~/tizen-sdk/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.p12
                    distributor1 password: *************************
                    distributor1 CA path: ~/tizen-sdk/tools/certificate-generator/certificates/distributor/tizen-distributor-ca.cer
                  

                  Or for Windows:

                    > tizen.bat security-profiles list
                  
                    > tizen.bat security-profiles list -n MyProfile
                  
                • Removes the security profile:

                    $ tizen security-profiles remove -n MyProfile
                    Loaded in '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    Wrote to '~/tizen-sdk-data/ide/keystore/profiles.xml'.
                    Succeed to remove 'MyProfile' profile.
                  

                  Or for Windows:

                    > tizen.bat security-profiles remove -n MyProfile
                  
                tizen package

                Packages the Tizen application with signing. If there is a package file path in the options, the package is re-signed.

                The Tizen application is signed with a certified profile named profiles.xml. You can create the default profile from the Tizen IDE, which generates the file in a hidden directory in your workspace (<Your workspace directory>/.metadata/.plugins/org.tizen.common.sign/profiles.xml). Set the path of the profile.xml file once before packaging the Tizen application (you can use the tizen cli-config command).

                Syntax:

                    tizen package [-t {tpk|wgt}] [-s <security profile name>] [-S {on|off}] [--]
                  

                  Options:

                  • -t, --type:

                    Specifies the package type.

                  • -s, --sign:

                    Specifies the profile name to use for signing.

                  • -S, --strip:

                    Determines whether to strip the native binary.

                    The default value is off. This option only works when the native binary is based on the arm architecture and release build configuration.

                  • --:

                    Specifies the build output path or package file path, which is contained in a file name, for re-signing the package.

                  Examples:

                  • Sets up the path of the profile.xml file that you already have:

                      $ tizen cli-config –g default.profiles.path=/home/tizen-sdk/tools/ide/conf/profiles.xml
                    

                    Or for Windows:

                      > tizen.bat cli-config –g "default.profiles.path=C:\tizen-sdk\tools\ide\conf\profiles.xml"
                    
                  • Sets up the path of the profile.xml file that is created from the IDE:

                      $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
                    

                    Or for Windows:

                      > tizen.bat cli-config –g "default.profiles.path=C:\Users\workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"
                    
                  • Packages the project:

                      $ tizen package –-type tpk –-sign myprofile -- /home/workspace/basic/Debug
                    
                      $ ls /home/workspace/basic/Debug
                    
                      org.tizen.basic-1.0.0-i386.tpk
                    

                    Or for Windows:

                      > tizen.bat package –-type tpk –-sign myprofile -- C:\Users\workspace\basic\Debug
                    
                  • Re-signs the package:

                      $ tizen package --type tpk --sign myprofile2 -- /home/workspace/basic/Debug/org.tizen.basic-1.0.0-i386.tpk
                    

                    Or for Windows:

                      > tizen.bat package --type tpk --sign myprofile2 -- C:\Users\workspace\basic\Debug\org.tizen.basic-1.0.0-i386.tpk
                    
                  tizen install

                  Installs a Tizen application on the target.

                  Syntax:

                      tizen install [-t <target name>] [-n <package name>] [--]
                    

                    Options:

                    • -t, --target:

                      Specifies the target, where the Tizen package is installed.

                    • -n, --name:

                      Specifies the Tizen package file name.

                    • --:

                      Specifies the directory path where the package is saved.

                    Examples:

                    • Installs a basic application named org.tizen.basic-1.0.0-i386.tpk to the emulator-26101:

                        $ tizen install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- /home/workspace/basic/Debug
                      

                      Or for Windows:

                        > tizen.bat install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- C:\Users\workspace\basic\Debug
                      
                    tizen uninstall

                    Uninstalls the Tizen application on the target.

                    Syntax:

                        tizen uninstall [-t <target name>] [-p <package id>]
                      

                      Options:

                      • -t, --target:

                        Specifies the target, from where the Tizen package is uninstalled.

                      • -p, --pkgid:

                        Specifies the Tizen package ID installed on the target.

                      Examples:

                      • Uninstalls a basic application whose pkgid is org.tizen.basic from the emulator-26101:

                          $ tizen uninstall -–target emulator-26101 -–pkgid org.tizen.basic
                        
                      tizen run

                      Runs the Tizen application on the target.

                      Syntax:

                          tizen run [-t <target name>] [-p <package id>]
                        

                        Options:

                        • -t, --target:

                          Specifies the target, where the Tizen package is run.

                        • -p, --pkgid:

                          Specifies the Tizen package ID installed on the target.

                        Examples:

                        • Runs the basic application whose pkgid is org.tizen.basic on the emulator-26101:

                            $ tizen run -–target emulator-26101 –-pkgid org.tizen.basic
                          
                        tizen version

                        Displays the CLI version number.

                        Syntax:

                            tizen version
                          

                          Examples:

                          • Displays the CLI version:

                              $ tizen version
                              Tizen CLI 1.0.0
                          Go to top