Device Info (FR)

Perfecto Command

mobile:device:info

Purpose

Retrieves the specified device property and inserts its value into a defined variable. Use the Property parameter to specify the device property to retrieve.

Restriction: The properties current activity and current package are only supported for Android.

Parameters

Name

Type

Possible Values

Description

property

String

manufacturer | model | phoneNumber | deviceId | resolution |
resolutionWidth | resolutionHeight | os | osVersion | firmware | location | network | distributer | language | imsi | nativeImei | wifiMacAddress |
cradleId | status | inUse | description | position | method | rotation | locked | roles |
currentActivity |
currentPackage | all | hasAudio | automationInfrastructure

Device property to retrieve. Only one property is retrieved in a single call.

Return Value

String value of the retrieved property

Exceptions

None

Examples

Copy

Java sample

 Map<String, Object> params = new HashMap<>();
 params.put("property", "model");
 String model = (String) driver.executeScript("mobile:device:info", params);
Copy

C# code snippet

 Dictionary<String, Object> pars = new Dictionary<String, Object>();
 pars.Add("property", "model");
 String model = (String) driver.ExecuteScript("mobile:device:info", pars);