Package io.appium.java_client
Class MobileCommand
- java.lang.Object
-
- io.appium.java_client.MobileCommand
-
- Direct Known Subclasses:
AndroidMobileCommandHelper,IOSMobileCommandHelper
public class MobileCommand extends java.lang.ObjectThe repository of mobile commands defined in the Mobile JSON wire protocol. Most of these commands are platform-specific obsolete things and should eventually be replaced with calls to corresponding `mobile:` extensions, so we don't abuse non-w3c APIs
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringACTIVATE_APPDeprecated.static java.lang.StringCLOSE_APPDeprecated.static java.util.Map<java.lang.String,org.openqa.selenium.remote.CommandInfo>commandRepositoryprotected static java.lang.StringCOMPARE_IMAGESstatic java.lang.StringCURRENT_ACTIVITYDeprecated.protected static java.lang.StringEND_TEST_COVERAGEDeprecated.protected static java.lang.StringEXECUTE_DRIVER_SCRIPTprotected static java.lang.StringEXECUTE_GOOGLE_CDP_COMMANDprotected static java.lang.StringFINGER_PRINTDeprecated.protected static java.lang.StringGET_ALLSESSIONDeprecated.static java.lang.StringGET_CLIPBOARDDeprecated.static java.lang.StringGET_CURRENT_PACKAGEDeprecated.protected static java.lang.StringGET_DEVICE_TIMEDeprecated.protected static java.lang.StringGET_DISPLAY_DENSITYDeprecated.protected static java.lang.StringGET_EVENTSprotected static java.lang.StringGET_NETWORK_CONNECTIONDeprecated.protected static java.lang.StringGET_PERFORMANCE_DATADeprecated.protected static java.lang.StringGET_SESSIONDeprecated.protected static java.lang.StringGET_SETTINGSprotected static java.lang.StringGET_STRINGSDeprecated.protected static java.lang.StringGET_SUPPORTED_PERFORMANCE_DATA_TYPESDeprecated.protected static java.lang.StringGET_SYSTEM_BARSDeprecated.static java.lang.StringGSM_CALLDeprecated.static java.lang.StringGSM_SIGNALDeprecated.static java.lang.StringGSM_VOICEDeprecated.protected static java.lang.StringHIDE_KEYBOARDDeprecated.protected static java.lang.StringINSTALL_APPDeprecated.protected static java.lang.StringIS_APP_INSTALLEDDeprecated.protected static java.lang.StringIS_KEYBOARD_SHOWNDeprecated.protected static java.lang.StringIS_LOCKEDDeprecated.static java.lang.StringLAUNCH_APPDeprecated.protected static java.lang.StringLOCKDeprecated.protected static java.lang.StringLOG_EVENTstatic java.lang.StringLONG_PRESS_KEY_CODEDeprecated.static java.lang.StringNETWORK_SPEEDDeprecated.protected static java.lang.StringOPEN_NOTIFICATIONSDeprecated.protected static java.lang.StringPERFORM_MULTI_TOUCHDeprecated.protected static java.lang.StringPERFORM_TOUCH_ACTIONDeprecated.static java.lang.StringPOWER_AC_STATEDeprecated.static java.lang.StringPOWER_CAPACITYDeprecated.static java.lang.StringPRESS_KEY_CODEDeprecated.protected static java.lang.StringPULL_FILEDeprecated.protected static java.lang.StringPULL_FOLDERDeprecated.protected static java.lang.StringPUSH_FILEDeprecated.protected static java.lang.StringQUERY_APP_STATEDeprecated.protected static java.lang.StringREMOVE_APPDeprecated.static java.lang.StringREPLACE_VALUEDeprecated.protected static java.lang.StringRESETDeprecated.static java.lang.StringRUN_APP_IN_BACKGROUNDDeprecated.static java.lang.StringSEND_SMSDeprecated.static java.lang.StringSET_CLIPBOARDDeprecated.protected static java.lang.StringSET_NETWORK_CONNECTIONDeprecated.protected static java.lang.StringSET_SETTINGSDeprecated.static java.lang.StringSET_VALUEDeprecated.protected static java.lang.StringSHAKEDeprecated.protected static java.lang.StringSTART_ACTIVITYDeprecated.static java.lang.StringSTART_RECORDING_SCREENDeprecated.static java.lang.StringSTOP_RECORDING_SCREENDeprecated.protected static java.lang.StringTERMINATE_APPDeprecated.protected static java.lang.StringTOGGLE_AIRPLANE_MODEDeprecated.protected static java.lang.StringTOGGLE_DATADeprecated.protected static java.lang.StringTOGGLE_LOCATION_SERVICESDeprecated.protected static java.lang.StringTOGGLE_WIFIDeprecated.protected static java.lang.StringTOUCH_IDDeprecated.protected static java.lang.StringTOUCH_ID_ENROLLMENTDeprecated.protected static java.lang.StringUNLOCKDeprecated.
-
Constructor Summary
Constructors Constructor Description MobileCommand()
-
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,?>>compareImagesCommand(ComparisonMode mode, byte[] img1Data, byte[] img2Data, BaseComparisonOptions options)Forms aMapof parameters for images comparison.static AppiumCommandInfodeleteC(java.lang.String url)This methods forms DELETE commands.static AppiumCommandInfogetC(java.lang.String url)This methods forms GET commands.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>getIsDeviceLockedCommand()Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>getSettingsCommand()static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>hideKeyboardCommand(java.lang.String keyName)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>hideKeyboardCommand(java.lang.String strategy, java.lang.String keyName)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>isKeyboardShownCommand()Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>lockDeviceCommand(java.time.Duration duration)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>longPressKeyCodeCommand(int key)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>longPressKeyCodeCommand(int key, java.lang.Integer metastate)Deprecated.This helper is deprecated and will be removed in future versions.static AppiumCommandInfopostC(java.lang.String url)This methods forms POST commands.static com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object>prepareArguments(java.lang.String[] params, java.lang.Object[] values)Prepares collection of arguments.static com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object>prepareArguments(java.lang.String param, java.lang.Object value)Prepares single argument.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>pressKeyCodeCommand(int key)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>pressKeyCodeCommand(int key, java.lang.Integer metastate)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>pushFileCommand(java.lang.String remotePath, byte[] base64Data)Deprecated.This helper is deprecated and will be removed in future versions.static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>setSettingsCommand(java.lang.String setting, java.lang.Object value)static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>setSettingsCommand(java.util.Map<java.lang.String,java.lang.Object> settings)static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>startRecordingScreenCommand(BaseStartScreenRecordingOptions opts)static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>stopRecordingScreenCommand(BaseStopScreenRecordingOptions opts)static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>>unlockDeviceCommand()Deprecated.This helper is deprecated and will be removed in future versions.
-
-
-
Field Detail
-
RESET
@Deprecated protected static final java.lang.String RESET
Deprecated.
-
GET_STRINGS
@Deprecated protected static final java.lang.String GET_STRINGS
Deprecated.
-
SET_VALUE
@Deprecated public static final java.lang.String SET_VALUE
Deprecated.
-
PULL_FILE
@Deprecated protected static final java.lang.String PULL_FILE
Deprecated.
-
PULL_FOLDER
@Deprecated protected static final java.lang.String PULL_FOLDER
Deprecated.
-
RUN_APP_IN_BACKGROUND
@Deprecated public static final java.lang.String RUN_APP_IN_BACKGROUND
Deprecated.
-
PERFORM_TOUCH_ACTION
@Deprecated protected static final java.lang.String PERFORM_TOUCH_ACTION
Deprecated.
-
PERFORM_MULTI_TOUCH
@Deprecated protected static final java.lang.String PERFORM_MULTI_TOUCH
Deprecated.
-
LAUNCH_APP
@Deprecated public static final java.lang.String LAUNCH_APP
Deprecated.
-
CLOSE_APP
@Deprecated public static final java.lang.String CLOSE_APP
Deprecated.
-
GET_DEVICE_TIME
@Deprecated protected static final java.lang.String GET_DEVICE_TIME
Deprecated.
-
GET_SESSION
@Deprecated protected static final java.lang.String GET_SESSION
Deprecated.
-
LOG_EVENT
protected static final java.lang.String LOG_EVENT
-
GET_EVENTS
protected static final java.lang.String GET_EVENTS
-
IS_APP_INSTALLED
@Deprecated protected static final java.lang.String IS_APP_INSTALLED
Deprecated.
-
INSTALL_APP
@Deprecated protected static final java.lang.String INSTALL_APP
Deprecated.
-
ACTIVATE_APP
@Deprecated protected static final java.lang.String ACTIVATE_APP
Deprecated.
-
QUERY_APP_STATE
@Deprecated protected static final java.lang.String QUERY_APP_STATE
Deprecated.
-
TERMINATE_APP
@Deprecated protected static final java.lang.String TERMINATE_APP
Deprecated.
-
REMOVE_APP
@Deprecated protected static final java.lang.String REMOVE_APP
Deprecated.
-
GET_CLIPBOARD
@Deprecated public static final java.lang.String GET_CLIPBOARD
Deprecated.
-
SET_CLIPBOARD
@Deprecated public static final java.lang.String SET_CLIPBOARD
Deprecated.
-
GET_PERFORMANCE_DATA
@Deprecated protected static final java.lang.String GET_PERFORMANCE_DATA
Deprecated.
-
GET_SUPPORTED_PERFORMANCE_DATA_TYPES
@Deprecated protected static final java.lang.String GET_SUPPORTED_PERFORMANCE_DATA_TYPES
Deprecated.
-
START_RECORDING_SCREEN
@Deprecated public static final java.lang.String START_RECORDING_SCREEN
Deprecated.
-
STOP_RECORDING_SCREEN
@Deprecated public static final java.lang.String STOP_RECORDING_SCREEN
Deprecated.
-
HIDE_KEYBOARD
@Deprecated protected static final java.lang.String HIDE_KEYBOARD
Deprecated.
-
LOCK
@Deprecated protected static final java.lang.String LOCK
Deprecated.
-
SHAKE
@Deprecated protected static final java.lang.String SHAKE
Deprecated.
-
TOUCH_ID
@Deprecated protected static final java.lang.String TOUCH_ID
Deprecated.
-
TOUCH_ID_ENROLLMENT
@Deprecated protected static final java.lang.String TOUCH_ID_ENROLLMENT
Deprecated.
-
CURRENT_ACTIVITY
@Deprecated public static final java.lang.String CURRENT_ACTIVITY
Deprecated.
-
END_TEST_COVERAGE
@Deprecated protected static final java.lang.String END_TEST_COVERAGE
Deprecated.
-
GET_DISPLAY_DENSITY
@Deprecated protected static final java.lang.String GET_DISPLAY_DENSITY
Deprecated.
-
GET_NETWORK_CONNECTION
@Deprecated protected static final java.lang.String GET_NETWORK_CONNECTION
Deprecated.
-
GET_SYSTEM_BARS
@Deprecated protected static final java.lang.String GET_SYSTEM_BARS
Deprecated.
-
IS_KEYBOARD_SHOWN
@Deprecated protected static final java.lang.String IS_KEYBOARD_SHOWN
Deprecated.
-
IS_LOCKED
@Deprecated protected static final java.lang.String IS_LOCKED
Deprecated.
-
LONG_PRESS_KEY_CODE
@Deprecated public static final java.lang.String LONG_PRESS_KEY_CODE
Deprecated.
-
FINGER_PRINT
@Deprecated protected static final java.lang.String FINGER_PRINT
Deprecated.
-
OPEN_NOTIFICATIONS
@Deprecated protected static final java.lang.String OPEN_NOTIFICATIONS
Deprecated.
-
PRESS_KEY_CODE
@Deprecated public static final java.lang.String PRESS_KEY_CODE
Deprecated.
-
PUSH_FILE
@Deprecated protected static final java.lang.String PUSH_FILE
Deprecated.
-
SET_NETWORK_CONNECTION
@Deprecated protected static final java.lang.String SET_NETWORK_CONNECTION
Deprecated.
-
START_ACTIVITY
@Deprecated protected static final java.lang.String START_ACTIVITY
Deprecated.
-
TOGGLE_LOCATION_SERVICES
@Deprecated protected static final java.lang.String TOGGLE_LOCATION_SERVICES
Deprecated.
-
UNLOCK
@Deprecated protected static final java.lang.String UNLOCK
Deprecated.
-
REPLACE_VALUE
@Deprecated public static final java.lang.String REPLACE_VALUE
Deprecated.
-
GET_SETTINGS
protected static final java.lang.String GET_SETTINGS
-
SET_SETTINGS
@Deprecated protected static final java.lang.String SET_SETTINGS
Deprecated.
-
GET_CURRENT_PACKAGE
@Deprecated public static final java.lang.String GET_CURRENT_PACKAGE
Deprecated.
-
SEND_SMS
@Deprecated public static final java.lang.String SEND_SMS
Deprecated.
-
GSM_CALL
@Deprecated public static final java.lang.String GSM_CALL
Deprecated.
-
GSM_SIGNAL
@Deprecated public static final java.lang.String GSM_SIGNAL
Deprecated.
-
GSM_VOICE
@Deprecated public static final java.lang.String GSM_VOICE
Deprecated.
-
NETWORK_SPEED
@Deprecated public static final java.lang.String NETWORK_SPEED
Deprecated.
-
POWER_CAPACITY
@Deprecated public static final java.lang.String POWER_CAPACITY
Deprecated.
-
POWER_AC_STATE
@Deprecated public static final java.lang.String POWER_AC_STATE
Deprecated.
-
TOGGLE_WIFI
@Deprecated protected static final java.lang.String TOGGLE_WIFI
Deprecated.
-
TOGGLE_AIRPLANE_MODE
@Deprecated protected static final java.lang.String TOGGLE_AIRPLANE_MODE
Deprecated.
-
TOGGLE_DATA
@Deprecated protected static final java.lang.String TOGGLE_DATA
Deprecated.
-
COMPARE_IMAGES
protected static final java.lang.String COMPARE_IMAGES
-
EXECUTE_DRIVER_SCRIPT
protected static final java.lang.String EXECUTE_DRIVER_SCRIPT
-
GET_ALLSESSION
@Deprecated protected static final java.lang.String GET_ALLSESSION
Deprecated.
-
EXECUTE_GOOGLE_CDP_COMMAND
protected static final java.lang.String EXECUTE_GOOGLE_CDP_COMMAND
-
commandRepository
public static final java.util.Map<java.lang.String,org.openqa.selenium.remote.CommandInfo> commandRepository
-
-
Method Detail
-
getC
public static AppiumCommandInfo getC(java.lang.String url)
This methods forms GET commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
postC
public static AppiumCommandInfo postC(java.lang.String url)
This methods forms POST commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
deleteC
public static AppiumCommandInfo deleteC(java.lang.String url)
This methods forms DELETE commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
hideKeyboardCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> hideKeyboardCommand(java.lang.String keyName)
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the keyboard hiding.- Parameters:
keyName- The button pressed by the mobile driver to attempt hiding the keyboard.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
hideKeyboardCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> hideKeyboardCommand(java.lang.String strategy, java.lang.String keyName)Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the keyboard hiding.- Parameters:
strategy- HideKeyboardStrategy.keyName- a String, representing the text displayed on the button of the keyboard you want to press. For example: "Done".- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
prepareArguments
public static com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> prepareArguments(java.lang.String param, java.lang.Object value)Prepares single argument.- Parameters:
param- is a parameter name.value- is the parameter value.- Returns:
- built
ImmutableMap.
-
prepareArguments
public static com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> prepareArguments(java.lang.String[] params, java.lang.Object[] values)Prepares collection of arguments.- Parameters:
params- is the array with parameter names.values- is the array with parameter values.- Returns:
- built
ImmutableMap.
-
pressKeyCodeCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> pressKeyCodeCommand(int key)
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the key event invocation.- Parameters:
key- code for the key pressed on the device.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
pressKeyCodeCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> pressKeyCodeCommand(int key, java.lang.Integer metastate)Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the key event invocation.- Parameters:
key- code for the key pressed on the Android device.metastate- metastate for the keypress.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
longPressKeyCodeCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> longPressKeyCodeCommand(int key)
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the long key event invocation.- Parameters:
key- code for the long key pressed on the device.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
longPressKeyCodeCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> longPressKeyCodeCommand(int key, java.lang.Integer metastate)Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the long key event invocation.- Parameters:
key- code for the long key pressed on the Android device.metastate- metastate for the long key press.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
lockDeviceCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> lockDeviceCommand(java.time.Duration duration)
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the device locking.- Parameters:
duration- for how long to lock the screen for. Minimum time resolution is one second- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
unlockDeviceCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> unlockDeviceCommand()
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the device unlocking.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
getIsDeviceLockedCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getIsDeviceLockedCommand()
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the device locked query.- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
getSettingsCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> getSettingsCommand()
-
setSettingsCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> setSettingsCommand(java.lang.String setting, java.lang.Object value)
-
setSettingsCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> setSettingsCommand(java.util.Map<java.lang.String,java.lang.Object> settings)
-
pushFileCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> pushFileCommand(java.lang.String remotePath, byte[] base64Data)Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the file pushing.- Parameters:
remotePath- Path to file to write data to on remote devicebase64Data- Base64 encoded byte array of data to write to remote device- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
startRecordingScreenCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> startRecordingScreenCommand(BaseStartScreenRecordingOptions opts)
-
stopRecordingScreenCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> stopRecordingScreenCommand(BaseStopScreenRecordingOptions opts)
-
compareImagesCommand
public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> compareImagesCommand(ComparisonMode mode, byte[] img1Data, byte[] img2Data, @Nullable BaseComparisonOptions options)
Forms aMapof parameters for images comparison.- Parameters:
mode- one of possible comparison modesimg1Data- base64-encoded data of the first imageimg2Data- base64-encoded data of the second imageoptions- comparison options- Returns:
- key-value pairs
-
isKeyboardShownCommand
@Deprecated public static java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,?>> isKeyboardShownCommand()
Deprecated.This helper is deprecated and will be removed in future versions.This method forms aMapof parameters for the checking of the keyboard state (is it shown or not).- Returns:
- a key-value pair. The key is the command name. The value is a
Mapcommand arguments.
-
-