Testing Gear Companion Apps using the Gear Emulator
Copyright Copyright 2014 Samsung Electronics Co. Ltd. All Rights Reserved. Though every care has been taken to ensure the accuracy of this document, Samsung Electronics Co., Ltd. cannot accept responsibility for any errors or omissions or for any loss occurred to any person, whether legal or natural, from acting, or refraining from action, as a result of the information contained herein. Information in this document is subject to change at any time without obligation to notify any person of such changes. Samsung Electronics Co. Ltd. may have patents or patent pending applications, trademarks copyrights or other intellectual property rights covering subject matter in this document. The furnishing of this document does not give the recipient or reader any license to these patents, trademarks copyrights or other intellectual property rights. No part of this document may be communicated, distributed, reproduced or transmitted in any form or by any means, electronic or mechanical or otherwise, for any purpose, without the prior written permission of Samsung Electronics Co. Ltd. The document is subject to revision without further notice. All brand names and product names mentioned in this document are trademarks or registered trademarks of their respective owners. For more information, please visit http://www.tizen.org/ License Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained herein are licensed under BSD-3-Clause. For details, see the Content License.
Table of Contents Preparing the SAP Server Test Environment... 4 Setting up the SAP Server Test Environment... 4 Installing Host manager in Emulator... 4 Connecting the Emulator and Host through the SAP Server... 6
1 SECTION Preparing the SAP Server Test Environment To prepare the SAP server test environment, you must acquire the required files and install the Host Manager for the Emulator. Setting up the SAP Server Test Environment For setting up the SAP server test environment, you must get the following apk files: 1. SAccessoryService_Emul.apk 2. SASystemProviders_ForEmul.apk Download Applications_for_Emulator.zip that includes the needed files. Extract the files and copy them to the host. Installing Host manager in Emulator To install the Host manager in the Emulator, install the.apk files in the following order: 1. SAccessoryService_Emul.apk 2. SASystemProviders_ForEmul.apk 4 Preparing the SAP Server Test Environment
After installation, run the Emulator for Samsung Accessory application in the host device. The application will display a Disconnected message. Figure 1 Running HostManagerEmulator in the host device 5 Preparing the SAP Server Test Environment
2 SECTION Connecting the Emulator and Host through the SAP Server Before you attempt connecting 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 is connected to WiFi or mobile network. WI-FI transport type is added to /res/xml/serviceprofile.xml of Gear application. To set up the connection: 1. Connect the host 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. 6. Run the virtual machine. 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. Note: If the above steps does not work, go to Settings > Application Manager. Find Samsung Accessory Service and clear the data. Then repeat the above steps. 6 Connecting the Emulator and Host through the SAP Server
Figure 2 Successful connection From now on, run your mobile app on the Android device already connected to the Gear emulator; and your Gear app on the Gear emulator so that you can test companion type apps. 7 Connecting the Emulator and Host through the SAP Server