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
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,
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
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 CanRecordScreen for AndroidClient
impl CanRecordScreen for AndroidClient
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,
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,
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,
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
impl CanReplaceValue for AndroidClient
source§impl ExecutesCDP for AndroidClient
impl ExecutesCDP for AndroidClient
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
impl HasAndroidClipboard for AndroidClient
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,
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
impl HasAndroidDeviceDetails for AndroidClient
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,
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
impl HasAppStrings for AndroidClient
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,
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,
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
impl HasBattery<AndroidCapabilities> for AndroidClient
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
impl HasClipboard for AndroidClient
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,
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,
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,
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
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,
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,
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
impl HasNetworkState for AndroidClient
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,
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
impl HasOnScreenKeyboard for AndroidClient
source§impl HasSettings for AndroidClient
impl HasSettings for AndroidClient
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,
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,
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
impl HasSupportedPerformanceDataType for AndroidClient
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,
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
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,
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
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,
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
impl InteractsWithApps for AndroidClient
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,
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,
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,
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,
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,
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,
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
impl LocksDevice for AndroidClient
source§impl PressesKey for AndroidClient
impl PressesKey for AndroidClient
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,
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
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,
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,
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
impl PushesFiles for AndroidClient
source§impl StartsActivity for AndroidClient
impl StartsActivity for AndroidClient
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,
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,
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 SupportsContextSwitching for AndroidClient
impl SupportsContextSwitching for AndroidClient
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,
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,
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
impl SupportsLocation for AndroidClient
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,
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