Package io.appium.java_client
Class MobileCommand
java.lang.Object
io.appium.java_client.MobileCommand
- Direct Known Subclasses:
AndroidMobileCommandHelper,IOSMobileCommandHelper
The 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
FieldsModifier and TypeFieldDescriptionprotected static final StringDeprecated.static final StringDeprecated.protected static final Stringstatic final StringDeprecated.protected static final StringDeprecated.protected static final Stringprotected static final Stringprotected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.static final Stringstatic final Stringstatic final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final Stringstatic final Stringprotected static final StringDeprecated.protected static final StringDeprecated.static final Stringstatic final Stringprotected static final StringDeprecated.protected static final Stringprotected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.protected static final Stringstatic final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final Stringprotected static final StringDeprecated.static final Stringstatic final Stringprotected static final StringDeprecated.static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final Stringprotected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated.protected static final StringDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompareImagesCommand(ComparisonMode mode, byte[] img1Data, byte[] img2Data, @Nullable BaseComparisonOptions options) Forms aMapof parameters for images comparison.static AppiumCommandInfoThis methods forms DELETE commands.static AppiumCommandInfoThis methods forms GET commands.Deprecated.This helper is deprecated and will be removed in future versions.hideKeyboardCommand(String keyName) Deprecated.This helper is deprecated and will be removed in future versions.hideKeyboardCommand(String strategy, String keyName) Deprecated.This helper is deprecated and will be removed in future versions.Deprecated.This helper is deprecated and will be removed in future versions.lockDeviceCommand(Duration duration) Deprecated.This helper is deprecated and will be removed in future versions.longPressKeyCodeCommand(int key) Deprecated.This helper is deprecated and will be removed in future versions.longPressKeyCodeCommand(int key, Integer metastate) Deprecated.This helper is deprecated and will be removed in future versions.static AppiumCommandInfoThis methods forms POST commands.prepareArguments(String[] params, Object[] values) Deprecated.prepareArguments(String param, Object value) Deprecated.pressKeyCodeCommand(int key) Deprecated.This helper is deprecated and will be removed in future versions.pressKeyCodeCommand(int key, Integer metastate) Deprecated.This helper is deprecated and will be removed in future versions.pushFileCommand(String remotePath, byte[] base64Data) Deprecated.This helper is deprecated and will be removed in future versions.setSettingsCommand(String setting, Object value) setSettingsCommand(Map<String, Object> settings) Deprecated.This helper is deprecated and will be removed in future versions.
-
Field Details
-
RESET
Deprecated. -
GET_STRINGS
Deprecated. -
SET_VALUE
Deprecated. -
PULL_FILE
Deprecated. -
PULL_FOLDER
Deprecated. -
RUN_APP_IN_BACKGROUND
Deprecated. -
PERFORM_TOUCH_ACTION
Deprecated. -
PERFORM_MULTI_TOUCH
Deprecated. -
LAUNCH_APP
Deprecated. -
CLOSE_APP
Deprecated. -
GET_DEVICE_TIME
Deprecated. -
GET_SESSION
Deprecated. -
LOG_EVENT
-
GET_EVENTS
-
IS_APP_INSTALLED
Deprecated. -
INSTALL_APP
Deprecated. -
ACTIVATE_APP
Deprecated. -
QUERY_APP_STATE
Deprecated. -
TERMINATE_APP
Deprecated. -
REMOVE_APP
Deprecated. -
GET_CLIPBOARD
Deprecated. -
SET_CLIPBOARD
Deprecated. -
GET_PERFORMANCE_DATA
Deprecated. -
GET_SUPPORTED_PERFORMANCE_DATA_TYPES
Deprecated. -
START_RECORDING_SCREEN
Deprecated. -
STOP_RECORDING_SCREEN
Deprecated. -
HIDE_KEYBOARD
Deprecated. -
LOCK
Deprecated. -
SHAKE
Deprecated. -
TOUCH_ID
Deprecated. -
TOUCH_ID_ENROLLMENT
Deprecated. -
CURRENT_ACTIVITY
Deprecated. -
END_TEST_COVERAGE
Deprecated. -
GET_DISPLAY_DENSITY
Deprecated. -
GET_NETWORK_CONNECTION
Deprecated. -
GET_SYSTEM_BARS
Deprecated. -
IS_KEYBOARD_SHOWN
Deprecated. -
IS_LOCKED
Deprecated. -
LONG_PRESS_KEY_CODE
Deprecated. -
FINGER_PRINT
Deprecated. -
OPEN_NOTIFICATIONS
Deprecated. -
PRESS_KEY_CODE
Deprecated. -
PUSH_FILE
Deprecated. -
SET_NETWORK_CONNECTION
Deprecated. -
START_ACTIVITY
Deprecated. -
TOGGLE_LOCATION_SERVICES
Deprecated. -
UNLOCK
Deprecated. -
REPLACE_VALUE
Deprecated. -
GET_SETTINGS
-
SET_SETTINGS
Deprecated. -
GET_CURRENT_PACKAGE
Deprecated. -
SEND_SMS
Deprecated. -
GSM_CALL
Deprecated. -
GSM_SIGNAL
Deprecated. -
GSM_VOICE
Deprecated. -
NETWORK_SPEED
Deprecated. -
POWER_CAPACITY
Deprecated. -
POWER_AC_STATE
Deprecated. -
TOGGLE_WIFI
Deprecated. -
TOGGLE_AIRPLANE_MODE
Deprecated. -
TOGGLE_DATA
Deprecated. -
COMPARE_IMAGES
-
EXECUTE_DRIVER_SCRIPT
-
GET_ALLSESSION
Deprecated. -
EXECUTE_GOOGLE_CDP_COMMAND
-
GET_SCREEN_ORIENTATION
- See Also:
-
SET_SCREEN_ORIENTATION
- See Also:
-
GET_SCREEN_ROTATION
- See Also:
-
SET_SCREEN_ROTATION
- See Also:
-
GET_CONTEXT_HANDLES
- See Also:
-
GET_CURRENT_CONTEXT_HANDLE
- See Also:
-
SWITCH_TO_CONTEXT
- See Also:
-
GET_LOCATION
- See Also:
-
SET_LOCATION
- See Also:
-
commandRepository
-
-
Constructor Details
-
MobileCommand
public MobileCommand()
-
-
Method Details
-
getC
This methods forms GET commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
postC
This methods forms POST commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
deleteC
This methods forms DELETE commands.- Parameters:
url- is the command URL- Returns:
- an instance of
CommandInfo
-
hideKeyboardCommand
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 Map.Entry<String,Map<String, hideKeyboardCommand?>> (String strategy, 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
@Deprecated public static com.google.common.collect.ImmutableMap<String,Object> prepareArguments(String param, Object value) Deprecated.Prepares single argument.- Parameters:
param- is a parameter name.value- is the parameter value.- Returns:
- built
ImmutableMap.
-
prepareArguments
@Deprecated public static com.google.common.collect.ImmutableMap<String,Object> prepareArguments(String[] params, Object[] values) Deprecated.Prepares collection of arguments.- Parameters:
params- is the array with parameter names.values- is the array with parameter values.- Returns:
- built
ImmutableMap.
-
pressKeyCodeCommand
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 Map.Entry<String,Map<String, pressKeyCodeCommand?>> (int key, 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.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 Map.Entry<String,Map<String, longPressKeyCodeCommand?>> (int key, 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.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.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.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
-
setSettingsCommand
-
setSettingsCommand
-
pushFileCommand
@Deprecated public static Map.Entry<String,Map<String, pushFileCommand?>> (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 Map.Entry<String,Map<String, startRecordingScreenCommand?>> (BaseStartScreenRecordingOptions opts) -
stopRecordingScreenCommand
public static Map.Entry<String,Map<String, stopRecordingScreenCommand?>> (BaseStopScreenRecordingOptions opts) -
compareImagesCommand
public static Map.Entry<String,Map<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.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.
-