Silk Mobile

Table of Contents (Homepage)

AddDevice

String addDevice(SerialNumber, DeviceName)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

Description

This command gives you the option to automate the add device process.

Parameters

  • SerialNumber: The serial number / UDID of the device to add.

  • DeviceName: The suggested name (will add prefix if the name already exists for a different device)

Usage

Designed command to add specific devices during runtime for testing.

Scenario: We have a device connected locally to the machine but it is not available on the device list. With this command we will add and set it for testing.

Parameters:

  • SerialNumber: will be set to 02dfe56321089ac2

  • DeviceName: will be set as Nexus 5

images/download/attachments/3310187/15.jpg

Upon execution of this command, we will see the device getting added with the name we specified.

images/download/attachments/3310187/16.jpg

Code Examples

Java Example
String str0 = client.addDevice("02dfe56321089ac2", "Nexus 5");
C# Example
string str0 = client.AddDevice("02dfe56321089ac2", "Nexus 5");
VBScript Example
str0 = client.AddDevice ( "02dfe56321089ac2", "Nexus 5" )
Report
Python Example
var0 = self.client.addDevice("02dfe56321089ac2", "Nexus 5")
Perl Example
my $str0 = $client->addDevice("02dfe56321089ac2", "Nexus 5");