iOSDeviceInfo Object

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

The iOSDeviceInfo object provides information about the given iOS device. The following table lists the iOSDeviceInfo object properties.

Note: All of these properties are read-only.
Property Description
CPUArchitecture String. The device's CPU architecture.
DeviceClass String. The device's class.
DeviceColor String. The color of the device’s front side. Depending on the device type and OS, this can be either a color name (black, white) or a hex value (#3b3b3c, #e1e4e3).
HardwareModel String. The name of the device’s hardware model.
HardwarePlatform String. The name of the device’s hardware platform.
ModelNumber String. The device’s model number.
ProductType String. The device’s product type.
SerialNumber String. The device’s serial number.

Example

The following code gets the iOSDeviceInfo object and posts some of its property values to the test log:

JavaScript, JScript

function GetDeviceInfo()
{
  var DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo;
  Log.Message("Device serial number: " + DeviceInfoObj.SerialNumber);
  Log.Message("Device model: " + DeviceInfoObj.HardwareModel);
  Log.Message("CPU type:" + DeviceInfoObj.CPUArchitecture);
}

Python

def GetDeviceInfo():
  DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo
  Log.Message("Device serial number: " + DeviceInfoObj.SerialNumber)
  Log.Message("Device model: " + DeviceInfoObj.HardwareModel)
  Log.Message("CPU type: " + DeviceInfoObj.CPUArchitecture)

VBScript

Sub GetDeviceInfo
  Set DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo
  Call Log.Message("Device serial number: " & DeviceInfoObj.SerialNumber)
  Call Log.Message("Device model: " & DeviceInfoObj.HardwareModel)
  Call Log.Message("CPU type: " & DeviceInfoObj.CPUArchitecture)
End Sub

DelphiScript

procedure GetDeviceInfo();
var DeviceInfoObj;
begin
   DeviceInfoObj := Mobile.Device('MyDevice').DeviceInfo;
   Log.Message('Device serial number: ' + DeviceInfoObj.SerialNumber);
   Log.Message('Device model: ' + DeviceInfoObj.HardwareModel);
   Log.Message('CPU type: ' + DeviceInfoObj.CPUArchitecture);
end;

C++Script, C#Script

function GetDeviceInfo()
{
  var DeviceInfoObj = Mobile["Device"]("MyDevice")["DeviceInfo"];
  Log["Message"]("Device serial number: " + DeviceInfoObj["SerialNumber"]);
  Log["Message"]("Device model: " + DeviceInfoObj["HardwareModel"]);
  Log["Message"]("CPU type:" + DeviceInfoObj["CPUArchitecture"]);
}

See Also

Testing iOS Applications
DeviceInfo Property
AndroidDeviceInfo Object

Highlight search results