Type Alias appium_client::AndroidClient

source ·
pub type AndroidClient = Client<AndroidCapabilities>;
Expand description

Client used to automate Android testing

To create AndroidClient, you need to use ClientBuilder and AndroidCapabilities. Rust type system will automatically pick up that by using those capabilities, you mean to control an Android device.

See trait implementations to check available features (commands) of this client.

use appium_client::capabilities::{AppCapable, UdidCapable, UiAutomator2AppCompatible};
use appium_client::capabilities::android::AndroidCapabilities;
use appium_client::ClientBuilder;

let mut capabilities = AndroidCapabilities::new_uiautomator();
capabilities.udid("emulator-5554");
capabilities.app("/apps/sample.apk");
capabilities.app_wait_activity("com.example.AppActivity");

let client = ClientBuilder::native(capabilities)
   .connect("http://localhost:4723/wd/hub/")
   .await?;

// congratulations, you have successfully created an AndroidClient

Aliased Type§

struct AndroidClient { /* private fields */ }

Trait Implementations§

source§

impl AndroidCanRecordScreen for AndroidClient

source§

fn start_recording<'life0, 'async_trait>( &'life0 self, bit_rate: Option<u32>, video_size: Option<String>, bug_report: Option<bool>, force_restart: Option<bool>, time_limit: Option<Duration>, options: ScreenRecordingUploadOptions ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Starts screen recording (Android). Read more
source§

fn stop_recording<'life0, 'async_trait>( &'life0 self, options: ScreenRecordingUploadOptions ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl AuthenticatesByFinger for AndroidClient

source§

fn use_finger_print<'life0, 'async_trait>( &'life0 self, id: u8 ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl CanRecordScreen for AndroidClient

source§

fn start_recording_screen<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn start_recording_with_options<'life0, 'async_trait>( &'life0 self, force_restart: Option<bool>, time_limit: Option<Duration>, options: HashMap<String, Value> ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn stop_recording_screen<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn stop_recording_with_options<'life0, 'async_trait>( &'life0 self, options: HashMap<String, Value> ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl CanReplaceValue for AndroidClient

source§

fn replace_value<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, element: &'life1 Element, value: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl ExecutesCDP for AndroidClient

source§

fn execute_cdp_command<'life0, 'life1, 'async_trait>( &'life0 self, command: &'life1 str, params: Option<HashMap<String, Value>> ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl HasAndroidClipboard for AndroidClient

source§

fn set_clipboard_labeled<'life0, 'life1, 'async_trait, CT>( &'life0 self, label: &'life1 str, content_type: ClipboardContentType, content: CT ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where CT: AsRef<[u8]> + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn set_clipboard_text_labeled<'life0, 'life1, 'async_trait, CT>( &'life0 self, label: &'life1 str, content: CT ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where CT: AsRef<[u8]> + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl HasAndroidDeviceDetails for AndroidClient

source§

fn display_density<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<u64, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn system_bars<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HashMap<String, Value>>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasAppStrings for AndroidClient

source§

fn app_strings_default_lang<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn app_strings<'life0, 'life1, 'async_trait>( &'life0 self, lang: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn app_strings_from_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, lang: &'life1 str, file: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl HasBattery<AndroidCapabilities> for AndroidClient

source§

fn battery_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<BatteryInfo<Caps>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasClipboard for AndroidClient

source§

fn get_clipboard<'life0, 'async_trait>( &'life0 self, content_type: ClipboardContentType ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_clipboard<'life0, 'async_trait, CT>( &'life0 self, content_type: ClipboardContentType, content: CT ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where CT: AsRef<[u8]> + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_clipboard_text<'life0, 'async_trait, CT>( &'life0 self, content: CT ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where CT: AsRef<[u8]> + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn get_clipboard_text<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasDeviceTime for AndroidClient

source§

fn device_time<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets device date and time for both iOS (host time is returned for simulators) and Android devices. The default format since Appium 1.8.2 is YYYY-MM-DDTHH:mm:ssZ, which complies to ISO-8601.
source§

fn device_time_with_format<'life0, 'life1, 'async_trait>( &'life0 self, format: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets device date and time for both iOS and Android devices with given format. Read more
source§

impl HasNetworkState for AndroidClient

source§

fn set_connection<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 ConnectionState ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn get_connection<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<ConnectionState, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasOnScreenKeyboard for AndroidClient

source§

fn keyboard_shown<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasSettings for AndroidClient

source§

fn set_settings<'life0, 'async_trait>( &'life0 self, values: Map<String, Value> ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_setting<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, value: Value ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn get_settings<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl HasSupportedPerformanceDataType for AndroidClient

source§

fn supported_performance_data_type<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn performance_data<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, package: &'life1 str, data_type: &'life2 str, read_timeout: u32 ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Value>>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl HidesKeyboard for AndroidClient

source§

fn hide_keyboard<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Tries to hide keyboard using default system mechanism. Read more
source§

fn hide_keyboard_with_key<'life0, 'life1, 'async_trait>( &'life0 self, key_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn hide_keyboard_with_strategy<'life0, 'life1, 'async_trait>( &'life0 self, strategy: HideKeyboardStrategy, key_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl InteractsWithApps for AndroidClient

source§

fn install_app<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn is_app_installed<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<bool, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn run_app_in_background<'life0, 'async_trait>( &'life0 self, duration: Duration ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn remove_app<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn activate_app<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn app_state<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<AppState, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn terminate_app<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl LocksDevice for AndroidClient

source§

fn lock_device<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Locks the device. Note: iOS can only be unlocked manually.
source§

impl PressesKey for AndroidClient

source§

fn press_key<'life0, 'async_trait>( &'life0 self, event: KeyEvent ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn long_press_key<'life0, 'async_trait>( &'life0 self, event: KeyEvent ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl PullsFiles for AndroidClient

source§

fn pull_file<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pulls a single file from device
source§

fn pull_folder<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pulls folder and returns zip file containing the content
source§

impl PushesFiles for AndroidClient

source§

fn push_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 str, data: &'life2 [u8] ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl StartsActivity for AndroidClient

source§

fn start_activity<'life0, 'async_trait>( &'life0 self, activity: AndroidActivity ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn current_activity<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn current_package<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl SupportsAndroidLocation for AndroidClient

source§

fn set_android_location<'life0, 'async_trait>( &'life0 self, location: AndroidGeoLocation ) -> Pin<Box<dyn Future<Output = Result<Location, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl SupportsContextSwitching for AndroidClient

source§

fn set_context<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn current_context<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Option<String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn available_contexts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl SupportsLocation for AndroidClient

source§

fn location<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Location, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_location<'life0, 'async_trait>( &'life0 self, location: Location ) -> Pin<Box<dyn Future<Output = Result<Location, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Tries to set location if the driver/device supports it. Returns location of device after the attempt. Read more
source§

impl SupportsNetworkStateManagement for AndroidClient

source§

fn toggle_wifi<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn toggle_airplane_mode<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn toggle_data<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl SupportsRotation for AndroidClient

source§

fn orientation<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Orientation, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_orientation<'life0, 'async_trait>( &'life0 self, orientation: Orientation ) -> Pin<Box<dyn Future<Output = Result<Orientation, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn rotation<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<DeviceRotation, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_rotation<'life0, 'async_trait>( &'life0 self, rotation: DeviceRotation ) -> Pin<Box<dyn Future<Output = Result<DeviceRotation, CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl SupportsSpecialEmulatorCommands for AndroidClient

source§

fn send_sms<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, phone_number: &'life1 str, message: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn make_gsm_call<'life0, 'life1, 'async_trait>( &'life0 self, phone_number: &'life1 str, action: GsmCallAction ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn set_signal_strength<'life0, 'async_trait>( &'life0 self, strength: GsmSignalStrength ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_gsm_voice_state<'life0, 'async_trait>( &'life0 self, state: GsmVoiceState ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_network_speed<'life0, 'async_trait>( &'life0 self, speed: NetworkSpeed ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_power_capacity<'life0, 'async_trait>( &'life0 self, percent: u8 ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

fn set_power_ac<'life0, 'async_trait>( &'life0 self, power: bool ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

source§

impl UnlocksDevice for AndroidClient

source§

fn unlock_device<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), CmdError>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait,

Unlocks the device. Read more