Simulator Developer Guide

Using app

This guide explains how to control your app on the Simulator.

Launching app

There are three ways of launching an app.

Using 'Launch App' on the menu or ‘App’ button on RCU

  1. Click Menu > File > Launch App or click the App button on the bottom of RCU.
  2. Select the root directory of the app and click OK. The root directory must be the directory where appinfo.json is located.

Using CLI command

Execute the following command on the terminal.

ares-launch -s VERSION /APP/DIR/PATH
// example
ares-launch -s 22 /home/user/myApp
  • The path can be either relative or absolute.
  • VERSION is the version of webOS TV. For example, it would be 22 for webOS TV 22 Simulator.

If there are multiple Simulators installed corresponding to the specified webOS TV version, the latest-version Simulator will be run and launch the app.

Clicking the app icon on the main screen or selecting the app on the app list window

Once an app is launched, its icon is added to the main screen and app list.

Clicking the app icon on the main screen or selecting the app on the app list window will launch the app.

Debugging

The Web Inspector is launched automatically when the app is run, so you can debug the app with it.

The screen shot for the simulator inspector

Closing app

You can close an app by either:

  • Clicking Menu > File > Close App, or
  • Clicking the Close button on the bottom of RCU

Removing app

To remove an app from the main screen and app list window, right-click the app to remove from the main screen or app list window and select Remove.

Auto-reload

As soon as you modify and save the code, your app is automatically reloaded, so you can check the result of the modification you made immediately.

Using service

This section explains how to control your service on the Simulator.

Adding service

You can add a JS Service on the Simulator.

  1. Click Menu > File > Add Service or click the Service button on the bottom of RCU.

  2. Select the root direction of the service to add and click OK.

    important

    The root directory must be the directory where package.json is located.

  3. Check if the service is successfully added on the JS Service window.

Starting / Stopping service

You can start or stop the added service.

  1. Click Menu > Tools > Service List.
  2. Click the service to start or stop on the JS Service window.

Removing service

You can remove a service.

  1. Click Menu > Tools > Service List.
  2. Right-click the service to remove from the JS Service window and select Remove.

Using RCU

This section shows the layout of RCU and explains the function of the buttons on it.

RCU layout

The screen shot of the simulator RCU

Buttons

Numbers, colors, directions, OK, and back 

These buttons use the same key code of buttons on a real RCU device. Apps can handle these key events.

Home

If this Home button is clicked while an app is running, the screen switches back to the main screen. At the time, the app stays hidden, not terminated, in the background.

Functional buttons

Functional buttons on the bottom do not exist on a real RCU device. These are only on the Simulator for development convenience.

  • App: Launching an app  (same as MenuFile > Launch App)
  • Service:  Adding a service (same as MenuFileAdd Service)
  • Inspector: Turning on or off the Inspector for the app
  • Close: Closing an app (same as MenuFileClose App)

Using touch mode

note

This feature is in its beta phase.

This guide shows how to turn on the touch mode and describes available touch gestures.

Turn on touch mode

You can turn on the touch mode on the menu bar or using the special key on the bottom of the RCU.

On the menu bar

On the menu bar, select Action > Touch Mode.

webOS TV Simulator touch mode menu

Using the special key

On the bottom of the RCU, click Touch.

webOS Tv Simulator touch mode - special key

Touch gestures

If the touch mode is enabled, a click with the mouse functions as a touch on the screen.

Basic gestures

Upon a click with the mouse, a different event depending on the value of supportTouchMode in appinfo.json is delivered to the app. A short touch is also available (A touch held for about 200ms or shorter is considered a short touch). For more details, see Touch Screen.

Swipe

A swipe from the edge of the window triggers a specific action as if a swipe on the device.

note

A swipe down from the top does not trigger any action.

Touch remote

Touch remote is also available.

webOS Tv Simulator touch remote

Using portrait mode

This section shows how to turn on the portrait mode and explains how it works.

Turn on portrait mode

You can turn on the portrait mode on the menu bar or using the special key on the bottom of the RCU.

On the menu bar

On the menu bar, select Action > Orientation > portrait.

webOS TV Simulator portrait mode menu

Using the special key

On the bottom of the RCU, click portrait.

webOS Tv Simulator portrait mode special key

note

You cannot select reversed_landscape and reversed_portrait on the RCU. Go to the menu bar to use those modes.

How portrait mode works

When the portrait mode is turned on,

  • webOSSystem.screenOrientation is changed, and
  • A screenOrientationChange event occurs.
note

Even if the orientation is changed to portrait, the orientation of the Simulator itself does not change.

If an app requests change of orientation using webOSSystem.setWindowOrientation, the orientation of the actual app layout changes. For more details about the portrait mode, see Portrait Mode.

No Headings