Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Retrieves the current activity running on the device.
The current activity name running on the device
str
Wait for an activity: block until target activity presents or time out.
This is an Android-only method.
activity – target activity
timeout – max wait time, in seconds
interval – sleep interval between retries, in seconds
True if the target activity is shown
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Retrieves the current package running on the device.
Open notification shade in Android (API Level 18 and above)
Self instance
Union[‘WebDriver’, ‘Common’]
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Get the display density, Android only
The display density of the Android device(dpi)
self.driver.get_display_density()
The display density
int
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Make GSM call (Emulator only)
Android only.
phone_number – The phone number to call to.
action – The call action. A member of the const appium.webdriver.extensions.android.gsm.GsmCallActions
self.driver.make_gsm_call(‘5551234567’, GsmCallActions.CALL)
Self instance
Union[‘WebDriver’, ‘Gsm’]
Set GSM signal strength (Emulator only)
Android only.
strength – Signal strength.
A member of the enum appium.webdriver.extensions.android.gsm.GsmSignalStrength
self.driver.set_gsm_signal(GsmSignalStrength.GOOD)
Self instance
Union[‘WebDriver’, ‘Gsm’]
Set GSM voice state (Emulator only)
Android only.
state – State of GSM voice. A member of the const appium.webdriver.extensions.android.gsm.GsmVoiceState
self.driver.set_gsm_voice(GsmVoiceState.HOME)
Self instance
Union[‘WebDriver’, ‘Gsm’]
Bases: object
Bases: object
Returns true if the key will, by default, trigger a click on the focused view.
Returns true if the specified nativekey is a gamepad button.
Returns true if this key is a media key, which can be send to apps that are interested in media key events.
Returns true if the key is a system key, System keys can not be used for menu shortcuts.
Returns true if the key is a wake key.
Bases: object
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Returns an integer bitmask specifying the network connection type.
Android only. Possible values are available through the enumeration appium.webdriver.ConnectionType
This API only works reliably on emulators (any version) and real devices since API level 31.
Sets the network connection type. Android only.
Possible values:
Value (Alias)
Data
Wifi
Airplane Mode
0 (None)
0
0
0
1 (Airplane Mode)
0
0
1
2 (Wifi only)
0
1
0
4 (Data only)
1
0
0
6 (All network on)
1
1
0
These are available through the enumeration appium.webdriver.ConnectionType
This API only works reliably on emulators (any version) and real devices since API level 31.
connection_type – a member of the enum appium.webdriver.ConnectionType
Set network connection type
int
Set the network speed emulation.
Android Emulator only.
speed_type – The network speed type. A member of the const appium.webdriver.extensions.android.network.NetSpeed.
self.driver.set_network_speed(NetSpeed.LTE)
Self instance
Union[‘WebDriver’, ‘Network’]
Toggle the wifi on the device, Android only. This API only works reliably on emulators (any version) and real devices since API level 31.
Self instance
Union[‘WebDriver’, ‘Network’]
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.
Android only.
package_name – The package name of the application
data_type – The type of system state which wants to read.
It should be one of the supported performance data types.
Check get_performance_data_types() for supported types
data_read_timeout – The number of attempts to read
self.driver.get_performance_data(‘my.app.package’, ‘cpuinfo’, 5)
The data along to data_type
Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery. Android only.
self.driver.get_performance_data_types()
Available data types
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Emulate power state change on the connected emulator.
Android only.
ac_state – The power ac state to be set. Use Power.AC_OFF, Power.AC_ON
Self instance
Union[‘WebDriver’, ‘Power’]
Emulate power capacity change on the connected emulator.
Android only.
percent – The power capacity to be set. Can be set from 0 to 100
self.driver.set_power_capacity(50)
Self instance
Union[‘WebDriver’, ‘Power’]
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Emulate send SMS event on the connected emulator.
Android only.
phone_number – The phone number of message sender
message – The message to send
self.driver.send_sms(‘555-123-4567’, ‘Hey lol’)
Self instance
Union[‘WebDriver’, ‘Sms’]
Bases: CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence
Retrieve visibility and bounds information of the status and navigation bars.
Android only.
visible
x
y
width
height
visible
x
y
width
height