Custom Node.JS CLI For Smartwatch Development

    If you’re looking for the full fledged Tizen CLI visit the Tizen Developer website here.

    Why a Node JS derived Tizen CLI?

    Create an OS-agnostic command-line tool for web developers that can be installed with contemporary IDEs like Visual Studio Code.

    And, of course, get familiar with Node JS, low-level APIs that communicate with the OS. Hence the bash scripting nature of the CLI tool, but instead using JavaScript.

    How does it work?

    The Node.JS CLI depends on the Tizen SDK and platform tools to compile, sign, package, and install Tizen Web Apps on the Tizen Emulator and Samsung Watch Device. You can learn more about the Tizen OS platform and dev tools here.

    At this moment the current version of the CLI supports only macOS. Possibly with a little more time and TLC it can support Linux and Windows.

    Node JS CLI Preview

    1) Create a New Project

    This commands creates a new Tizen Web App for wearables. Learn more about creating tizen web apps here.

    Create a new project

    2) Create a Certificate

    Allows you to install apps on the Tizen Emulator and on the Samsung Galaxy Watch device.

    Create a certificate

    3) Package your web app into a .wgt file

    This is the equivalent to a APK android file that you install on Android devices. You can learn more about the Tizen Web Application architecture here.

    Package your project

    4) Launch the Tizen Emulator
    Launch Tizen Emulator

    5) Debug

    This command launches the Chrome Developer Tool web inspector.

    Debug your app

    6) Shutdown

    This command terminates both the Chrome Dev Tool and emulator at the same time.

    Shutdown

    Now, I can install Node JS Tizen CLI with NPM anywhere on my local machine using Terminal or iTerm. When writing this, the Web debugger continues to only work with Google Chrome 80 and below. Luckily you can find a clean copy on the interwebs.

    Can anyone create a Node JS CLI absolutely? Yes, though, your mileage will vary. Below is a list of domain knowledge I needed on hand to put all the pieces together and some new items I had picked up along the way to get me to the finish line:

    • Tizen CLI instructions
    • Node JS CLI
    • JavaScript (Pure ES6)
    • Shell scripting (Unix/macOS)
    • Chrome Dev Tools
    • Terminal (macOS)
    • File system (map Tizen specific scripts in Node JS)
    • Google, StackOverflow, Stack Exchange, etc!
    • TCP, UDP (Networking)
    • Wireshark

    If you enjoyed this short segment, stay tuned for more CLI adventures.

    Until next time.