This posts discusses the steps required to install a third party wearable widget (.wgt) as a standalone app on the Samsung Gear 2 smart-watch or an emulator. It is assumed that you are the developer of the .wgt file and would like to be able to install /test it directly on your device without having to go through the app store.
About Smart Development Bridge (SDB).
For those with existing experience developing android apps, SDB is very similar to the Android Debug Bridge (ADB). Smart Development Bridge (SDB) is a command line tool for emulator/device management. It acts as an intermediary between a device and your development system and provides various device management capabilities such as moving and syncing files to the emulator, running a UNIX shell on the device or emulator. Using SDB tool you can: Manage connections to multiple instances of emulator/devices. You can list connected devices and send a command to a specific device with a serial number that is created by the SDB. Supply basic commands for application development, such as file transfer, remote shell command, port forwarding for a debugger, and viewing, filtering, and controlling device log output, and troubleshooting.
When you install the tizen wearable sdk, it automatically installs SDB (in the tools folder) . You can use sdb using the windows command line interface. SDB commands are of the form
$ sdb [option] <command> [parameters]
Where [option] can be:
-d: Directs the command to the only connected USB device and return an error if more than one USB device is present.
-e: Direct the command to the only running Emulator and return an error if more than one Emulator is present.
-s <serial number>: Direct the command to the USB device or Emulator with the defined serial number. If multiple Emulator or device instances are running, you need to specify a target instance in the SDB command.
To install a wgt file , the following steps can be followed.
Ensure You have the right Certificates
The wearable SDK help files contains a detailed guide on how to generate a signing certificate request. You can find it by going to help
Getting Started with Tizen Wearable > Development Environment > Tizen SDK for Wearable > Certificates > Sending a Certificate Request
Along this process, you will be asked to input the Device Unique ID (DUID) for the device you will be testing on. You can add both the DUID for your emulator and the DUID for your test gear 2 device.
To get the DUID for your gear 2 device ..
- Connect your device to your host computer or launch the Emulator.
- In the Connection Explorer, check that the connected device or Emulator is visible.
- Select the device or Emulator, and click Properties.The DUID is visible on the Info panel.
After you get this certificate registered, you should import it into your workspace and ensure its used to sign the .wgt file which you would like to sideload into your gear device. If the DUID of the gear device is not included in your certificate, an INVALID_SIGNATURE error would occur .
Also, if you are installing a wgt on a gear device for the first time, (ie no apps have been deployed from your wearable ide to the device previously) , perform the following steps if you keep getting the invalid_signature error above:
- In the Connection Explorer, select the /home/developer folder.
- Copy the certificate-registration.xml file containing the DUID of the target device to the /home/developer folder of the Wearable device.
Enable USB Debugging on Your Gear 2 Device and Connect it to Your
If you are using a physical gear 2 device, USB debugging needs to be enabled. On your gear 2
– Go to Settings by swiping to the right from the home screen
– Scroll to the last option named “Gear info”
You should be able to see two option now – About Gear and USB Debugging.
– Tap on USB Debugging and you would be seeing a warning, which warns you about the danger of enabling usb debugging. Do it anyway.
Copy your .wgt file to the SDB Folder.
– Locate your installation folder for your tizen sdk.
– Locate the tools directory inside it . For me , this folder was D:\tizen\tizen-wearable-sdk\tools
– You should see sdb.exe inside this folder
– Now copy your wgt file (xxx.wgt) to this folder
Ensure your Gear 2 device or Emulator is connected.
– Open command line (cmd on windows) and navigate to the tools folder.
– On the console type : sdb devices
This should list all your connected devices and emulator. If you have your real gear 2 connected via usb it should also show up here. It it doesnt, ensure all the necessary drivers are installed. Sometimes a re-installation of the gear 2 device may be helpful too.
Install the widget
On the console, type : sdb install xxx.wgt.
This should install the .wgt file on your connected device.
Using Gear Manager.
You can also install your .wgt files using gear manager. Following the integrated and linked type of gear 2 apps, the goal is to include the widget inside a host side apk which deployed to the gear 2 device when the apk is installed.
– Add the wgt file to the assets folder of your android project,
– Build and apk and install this apk on a connected samsung device through gear manager.
The wgt file will be automatically installed on a connected android wear device