Package io.appium.java_client.android
Class AndroidMobileCommandHelper
- java.lang.Object
-
- io.appium.java_client.MobileCommand
-
- io.appium.java_client.android.AndroidMobileCommandHelper
-
public class AndroidMobileCommandHelper extends MobileCommand
This util class helps to prepare parameters of Android-specific JSONWP commands.
-
-
Field Summary
-
Fields inherited from class io.appium.java_client.MobileCommand
ACTIVATE_APP, CLOSE_APP, commandRepository, COMPARE_IMAGES, CURRENT_ACTIVITY, END_TEST_COVERAGE, EXECUTE_DRIVER_SCRIPT, EXECUTE_GOOGLE_CDP_COMMAND, FINGER_PRINT, GET_ALLSESSION, GET_CLIPBOARD, GET_CONTEXT_HANDLES, GET_CURRENT_CONTEXT_HANDLE, GET_CURRENT_PACKAGE, GET_DEVICE_TIME, GET_DISPLAY_DENSITY, GET_EVENTS, GET_LOCATION, GET_NETWORK_CONNECTION, GET_PERFORMANCE_DATA, GET_SCREEN_ORIENTATION, GET_SCREEN_ROTATION, GET_SESSION, GET_SETTINGS, GET_STRINGS, GET_SUPPORTED_PERFORMANCE_DATA_TYPES, GET_SYSTEM_BARS, GSM_CALL, GSM_SIGNAL, GSM_VOICE, HIDE_KEYBOARD, INSTALL_APP, IS_APP_INSTALLED, IS_KEYBOARD_SHOWN, IS_LOCKED, LAUNCH_APP, LOCK, LOG_EVENT, LONG_PRESS_KEY_CODE, NETWORK_SPEED, OPEN_NOTIFICATIONS, PERFORM_MULTI_TOUCH, PERFORM_TOUCH_ACTION, POWER_AC_STATE, POWER_CAPACITY, PRESS_KEY_CODE, PULL_FILE, PULL_FOLDER, PUSH_FILE, QUERY_APP_STATE, REMOVE_APP, REPLACE_VALUE, RESET, RUN_APP_IN_BACKGROUND, SEND_SMS, SET_CLIPBOARD, SET_LOCATION, SET_NETWORK_CONNECTION, SET_SCREEN_ORIENTATION, SET_SCREEN_ROTATION, SET_SETTINGS, SET_VALUE, SHAKE, START_ACTIVITY, START_RECORDING_SCREEN, STOP_RECORDING_SCREEN, SWITCH_TO_CONTEXT, TERMINATE_APP, TOGGLE_AIRPLANE_MODE, TOGGLE_DATA, TOGGLE_LOCATION_SERVICES, TOGGLE_WIFI, TOUCH_ID, TOUCH_ID_ENROLLMENT, UNLOCK
-
-
Constructor Summary
Constructors Constructor Description AndroidMobileCommandHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
currentActivityCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
currentPackageCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
fingerPrintCommand(int fingerPrintId)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
getDisplayDensityCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
getNetworkConnectionCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
getPerformanceDataCommand(java.lang.String packageName, java.lang.String dataType, int dataReadTimeout)
returns the resource usage information of the application.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
getSupportedPerformanceDataTypesCommand()
returns the information type of the system state which is supported to read as like cpu, memory, network traffic, and battery.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
getSystemBarsCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
gsmCallCommand(java.lang.String phoneNumber, GsmCallActions gsmCallActions)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
gsmSignalStrengthCommand(GsmSignalStrength gsmSignalStrength)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
gsmVoiceCommand(GsmVoiceState gsmVoiceState)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
isLockedCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
networkSpeedCommand(NetworkSpeed networkSpeed)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
openNotificationsCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
powerACCommand(PowerACState powerACState)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
powerCapacityCommand(int percent)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
replaceElementValueCommand(org.openqa.selenium.remote.RemoteWebElement remoteWebElement, java.lang.String value)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
sendSMSCommand(java.lang.String phoneNumber, java.lang.String message)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
setConnectionCommand(long bitMask)
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
toggleAirplaneCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
toggleDataCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
toggleLocationServicesCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
toggleWifiCommand()
Deprecated.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>
unlockCommand()
Deprecated.-
Methods inherited from class io.appium.java_client.MobileCommand
compareImagesCommand, deleteC, getC, getIsDeviceLockedCommand, getSettingsCommand, hideKeyboardCommand, hideKeyboardCommand, isKeyboardShownCommand, lockDeviceCommand, longPressKeyCodeCommand, longPressKeyCodeCommand, postC, prepareArguments, prepareArguments, pressKeyCodeCommand, pressKeyCodeCommand, pushFileCommand, setSettingsCommand, setSettingsCommand, startRecordingScreenCommand, stopRecordingScreenCommand, unlockDeviceCommand
-
-
-
-
Method Detail
-
currentActivityCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> currentActivityCommand()
Deprecated.This method forms aMap
of parameters for the getting of the current activity.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
currentPackageCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> currentPackageCommand()
Deprecated.This method forms aMap
of parameters for the getting of the current package.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
getSupportedPerformanceDataTypesCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getSupportedPerformanceDataTypesCommand()
returns the information type of the system state which is supported to read as like cpu, memory, network traffic, and battery.- Returns:
- output - array like below [cpuinfo, batteryinfo, networkinfo, memoryinfo]
-
getPerformanceDataCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getPerformanceDataCommand(java.lang.String packageName, java.lang.String dataType, int dataReadTimeout)
returns the resource usage information of the application. the resource is one of the system state which means cpu, memory, network traffic, and battery.- Parameters:
packageName
- the package name of the applicationdataType
- the type of system state which wants to read. It should be one of the supported performance data types, the return value of the function "getSupportedPerformanceDataTypes"dataReadTimeout
- the number of attempts to read- Returns:
- table of the performance data, The first line of the table represents the type of data. The remaining lines represent the values of the data. in case of battery info : [[power], [23]] in case of memory info : [[totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss, nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize], [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]] in case of network info : [[bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration,], [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000], [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]] in case of network info : [[st, activeTime, rb, rp, tb, tp, op, bucketDuration], [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600], [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600], [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600], [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]] in case of cpu info : [[user, kernel], [0.9, 1.3]]
-
getDisplayDensityCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getDisplayDensityCommand()
Deprecated.This method forms aMap
of parameters to retrieve the display density of the Android device.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
getNetworkConnectionCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getNetworkConnectionCommand()
Deprecated.This method forms aMap
of parameters for the getting of a network connection value.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
getSystemBarsCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getSystemBarsCommand()
Deprecated.This method forms aMap
of parameters to retrieve visibility and bounds information of the status and navigation bars.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
isLockedCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> isLockedCommand()
Deprecated.This method forms aMap
of parameters for the finger print authentication invocation.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
fingerPrintCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> fingerPrintCommand(int fingerPrintId)
Deprecated.This method forms aMap
of parameters for the finger print authentication invocation.- Parameters:
fingerPrintId
- finger prints stored in Android Keystore system (from 1 to 10)- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
openNotificationsCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> openNotificationsCommand()
Deprecated.This method forms aMap
of parameters for the notification opening.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
setConnectionCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> setConnectionCommand(long bitMask)
Deprecated.This method forms aMap
of parameters for the setting of device network connection.- Parameters:
bitMask
- The bitmask of the desired connection- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
toggleLocationServicesCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> toggleLocationServicesCommand()
Deprecated.This method forms aMap
of parameters for the toggling of location services.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
unlockCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> unlockCommand()
Deprecated.This method forms aMap
of parameters for the element.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
replaceElementValueCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> replaceElementValueCommand(org.openqa.selenium.remote.RemoteWebElement remoteWebElement, java.lang.String value)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
remoteWebElement
- an instance which contains an element IDvalue
- a new value- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
sendSMSCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> sendSMSCommand(java.lang.String phoneNumber, java.lang.String message)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
phoneNumber
- The phone number of message sendermessage
- The message content- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
gsmCallCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> gsmCallCommand(java.lang.String phoneNumber, GsmCallActions gsmCallActions)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
phoneNumber
- The phone number of message sendergsmCallActions
- One of available GSM call actions- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
gsmSignalStrengthCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> gsmSignalStrengthCommand(GsmSignalStrength gsmSignalStrength)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
gsmSignalStrength
- One of available GSM signal strength- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
gsmVoiceCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> gsmVoiceCommand(GsmVoiceState gsmVoiceState)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
gsmVoiceState
- One of available GSM voice state- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
networkSpeedCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> networkSpeedCommand(NetworkSpeed networkSpeed)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
networkSpeed
- One of possible NETWORK_SPEED values- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
powerCapacityCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> powerCapacityCommand(int percent)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
percent
- A number in range [0, 4]- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
powerACCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> powerACCommand(PowerACState powerACState)
Deprecated.This method forms aMap
of parameters for the element value replacement. It is used against input elements- Parameters:
powerACState
- One of available power AC state- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
toggleWifiCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> toggleWifiCommand()
Deprecated.This method forms aMap
of parameters for the toggling of wifi.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
toggleAirplaneCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> toggleAirplaneCommand()
Deprecated.This method forms aMap
of parameters for the toggle airplane mode.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
toggleDataCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> toggleDataCommand()
Deprecated.This method forms aMap
of parameters for the toggle data.- Returns:
- a key-value pair. The key is the command name. The value is a
Map
command arguments.
-
-