Testing Your App on Galaxy Watch

Running on Device

Overview

Connect a Galaxy Watch device(Galaxy Watch S2, Galaxy Watch S3, and Galaxy Watch Fit2 only) to a Host PC via Wi-Fi. A wireless access point is needed to connect a Galaxy Watch Device to a Host PC.

Instructions

Project Explorer.

Host PC Set Up
  1. Connect the Host PC to the Wireless Access Point via UTP cable or Wi-Fi.

Project Explorer.

Galaxy Watch Device Set Up
  1. Turn on the Wi-Fi.

  2. Turn on debugging mode.

    Select Settings > Galaxy Watch Info > Debugging

  3. Reboot the device.

Connect the Host PC to the Wireless Access Point via UTP cable or Wi-Fi.

Connect a Galaxy Watch device to the Wireless Access Point via Wi-Fi

From the Wi-Fi menu of the Galaxy Watch device, find the Wireless Access Point and connect to it.

From the Wi-Fi menu of the Galaxy Watch S2 device, find the Wireless Access Point and connect to it.

Once connected, find the IP address that the Galaxy Watch device had received from the Access Point via DHCP. This IP address will be used during the SDB connection.

You can get this IP address by checking the information of the access point of the currently connected Galaxy Watch device.

You can get this IP address by checking the information of the access point the Galaxy Watch S2 device is currently connected to.

Now you are ready to connect the SDB in the IDE or command line.

Connecting via the IDE

Open the IDE and launch the Remote Device Manager.

Once the Remote Device Manager is open, it will start to scan for devices. Alternatively, click the scan button to scan again.

After scanning, you can find the list of devices that can connect. Select the Galaxy Watch device and click ‘Connect’.

The connected device will be displayed on the Connection Explorer.

Connecting via the SDB command line

Instead of using the IDE, you can connect via the SDB in the command line as well.
Open the terminal in the Host PC and use the following connect command.

    `$ sdb connect [Galaxy Watch S2 IP address]:26101
    Ex)

    $ sdb connect 192.168.0.11:26101` 

You can see the connected Galaxy Watch device by using SDB devices command.

    $ sdb devices
    List of devices attached
    192.168.0.11:26101      device       SM-R730A

After connecting, you can install apps or use the shell command line.

Installing the App

Open the terminal in the Host PC and use the following install command.

    `$ sdb install [path_to_wgt]
    Ex)

    $ sdb install /home/tizen/org.example.test-1.0.0-i386.wgt` 

Once the connection is completed, you can use the SDB command similar to the USB connected case.
Please refer to the link below for more details regarding SDB commands.
https://developer.tizen.org/development/tizen-studio/web-tools/running-and-testing-your-app/sdb

Troubleshooting
  • Confirm that the SDB version is 2.2.88 or later.

    $ sdb version
    
  • Try the kill-server command when a version warning message is shown.

    $ sdb kill-server
    
  • Turn off Bluetooth to reduce interference with Wi-Fi.

  • Move away from the charging dock to reduce interference with Wi-Fi.

Running on Remote Test Lab

Using the Remote Test Lab service, you can test your application on a real device. The Remote Test Lab service enables developers to access Samsung devices through the web and to install and test applications on the devices. This is not only the most effective and easiest way to test the compatibility of an application with Samsung devices but also the best way to cut down on hardware costs for test devices. Interaction with the device is performed over the network in real time allowing you to comprehensively test your application before distributing it.

The Remote Test Lab service is available to all users of the Samsung Developers Forum:
http://developer.samsung.com/remotetestlab/rtlDeviceList.action

For more details, please refer to the following link:
http://developer.samsung.com/remotetestlab/rtlAboutRTL.action

Samsung Developers Forum:

Galaxy Watch Emulator Set Up for Testing Companion Type Apps

Preparing the SAP Test Environment

To prepare the SAP test environment, you must acquire the required file and install the Host Manager for the Emulator.

Application for Emulator download

Application_for_Emulator.zip8.65MB
Setting up the SAP Server Test Environment

For setting up the SAP server test environment, you must get the following apk file:

  • SAccessoryService_Emul.apk

Download Application_for_Emulator that includes the needed file. Extract the file and copy them to the host.

Installing Host Manager in Emulator

To install the Host manager in the Emulator, install the .apk file in the following order:

  • SAccessoryService_Emul.apk

After installation, reboot and run the Emulator for Samsung Accessory application in the host device. The application will display a "Disconnected" message.

Figure 1: Running Emulator for Samsung Accessory in the mobile device

Connecting the Emulator and Host through the SAP Server

Before you attempt to connect the Emulator and Host, make sure the following prerequisites are met:

  • Android Debug Bridge (adb) is installed and environment path to adb is set.

  • Tizen SDK for Wearable is installed and running.

  • Host device should be connected to WiFi.

  • WI-FI transport type is added to "/res/xml/serviceprofile.xml" of Galaxy Watch application.

To set up the connection:

  1. Connect the host device and PC using a USB connection.

  2. Open the terminal or the command prompt in Windows.

  3. Enter the command: adb -d forward tcp:8230 tcp:8230.

  4. Run the emulator for Samsung Accessory in the host device.

  5. In the SDK, run the Emulator Manager and create a new virtual machine.

    Run the virtual machine. At the first boot, the device will display the screen below.
    It will reboot automatically to be connected with an Android device.
    (Auto-reboot is supported from Wearable Extension 1.2.0. At the previous version, the user should reboot manually at first boot.)

    Figure 2: Status after First Boot

    If the 'Disconnected' message does not change, restart the emulator with the hardware key or the command shutdown -r now. DO NOT use the command reboot.

    Figure 3: Successful connection

    From now on, run your mobile app on the Android device already connected to the Galaxy Watch emulator; and your Galaxy Watch app on the Galaxy Watch emulator so that you can test companion type apps.

Uninstalling applications for emulator

If you want to connect the Samsung Galaxy Watch with a real device, you have to delete “Application_for_Emulator”. Go to Settings > Application Manager then uninstall Samsung Accessory Service.

Preparing the Remote AppControl Test Environment

  1. Install Wearable Extension 1.2.0 or higher version.

  2. Set up above SAP test environment.

  3. Install WMSServiceProvider_Emul.apk to Android device.

WMSServiceProvider_Emul.apk1.12MB

How to enable Developer options

Developer can utilize additional features for app development and debugging by enabling Developer options on the Galaxy Watch device with Tizen version 2.3.2.3 or higher.

  1. Go to Settings -> Galaxy Watch info -> About device.

  2. Tap on Software version 5 times. Then a confirmation pop up displayed once the Developer options is enabled.

  3. You can find the Developer options in the list of Settings menu.