Struct EmulatorTools

Source
pub struct EmulatorTools { /* private fields */ }

Implementations§

Source§

impl EmulatorTools

Source

pub fn new() -> Self

Source

pub fn list_avds(&mut self, list_avds: bool) -> &mut Self

List available AVDs

Source

pub fn sysdir(&mut self, sysdir: &Path) -> &mut Self

Search for system disk images in

Source

pub fn system(&mut self, system: &Path) -> &mut Self

Read initial system image from

Source

pub fn vendor(&mut self, vendor: &Path) -> &mut Self

Read initial vendor image from

Source

pub fn writable_system(&mut self, writable_system: bool) -> &mut Self

Make system & vendor image writable after adb remount

Source

pub fn delay_adb(&mut self, delay_adb: bool) -> &mut Self

Delay adb communication till boot completes

Source

pub fn datadir(&mut self, datadir: &Path) -> &mut Self

Write user data into

Source

pub fn kernel(&mut self, kernel: &Path) -> &mut Self

Use specific emulated kernel

Source

pub fn ramdisk(&mut self, ramdisk: &Path) -> &mut Self

Ramdisk image (default /ramdisk.img)

Source

pub fn image(&mut self, image: &Path) -> &mut Self

Obsolete, use -system instead

Source

pub fn initdata(&mut self, initdata: &Path) -> &mut Self

Same as -init-data <file>

Source

pub fn data(&mut self, data: &Path) -> &mut Self

Data image (default /userdata-qemu.img)

Source

pub fn encryption_key(&mut self, encryption_key: &Path) -> &mut Self

Read initial encryption key image from

Source

pub fn logcat_output(&mut self, logcat_output: &Path) -> &mut Self

Output file of logcat(default none)

Source

pub fn partition_size(&mut self, partition_size: u32) -> &mut Self

System/data partition size in MBs

Source

pub fn cache(&mut self, cache: &Path) -> &mut Self

Cache partition image (default is temporary file)

Source

pub fn cache_size(&mut self, cache_size: u32) -> &mut Self

Cache partition size in MBs

Source

pub fn no_cache(&mut self, no_cache: bool) -> &mut Self

Disable the cache partition

Source

pub fn nocache(&mut self, nocache: bool) -> &mut Self

Same as -no-cache

Source

pub fn sdcard(&mut self, sdcard: &Path) -> &mut Self

SD card image (default /sdcard.img)

Source

pub fn quit_after_boot(&mut self, quit_after_boot: u32) -> &mut Self

Qeuit emulator after guest boots completely, or after timeout in seconds

Source

pub fn qemu_top_dir(&mut self, qemu_top_dir: &Path) -> &mut Self

Use the emulator in the specified dir (relative or absolute path)v

Source

pub fn monitor_adb(&mut self, monitor_adb: bool) -> &mut Self

Monitor the adb messages between guest and host, default not

Source

pub fn snapstorage(&mut self, snapstorage: &Path) -> &mut Self

File that contains all state snapshots (default /snapshots.img)

Source

pub fn no_snapstorage(&mut self, no_snapstorage: bool) -> &mut Self

Do not mount a snapshot storage file (this disables all snapshot functionality)

Source

pub fn snapshot(&mut self, snapshot: String) -> &mut Self

Name of snapshot within storage file for auto-start and auto-save (default ‘default-boot’)

Source

pub fn no_snapshot(&mut self, no_snapshot: bool) -> &mut Self

Perform a full boot and do not auto-save, but qemu vmload and vmsave operate on snapstorage

Source

pub fn no_snapshot_save(&mut self, no_snapshot_save: bool) -> &mut Self

Do not auto-save to snapshot on exit: abandon changed state

Source

pub fn no_snapshot_load(&mut self, no_snapshot_load: bool) -> &mut Self

Do not auto-start from snapshot: perform a full boot

Source

pub fn snapshot_list(&mut self, snapshot_list: bool) -> &mut Self

Show a list of available snapshots

Source

pub fn no_snapshot_update_time( &mut self, no_snapshot_update_time: bool, ) -> &mut Self

Do not try to correct snapshot time on restore

Source

pub fn wipe_data(&mut self, wipe_data: bool) -> &mut Self

Reset the user data image (copy it from initdata)

Source

pub fn avd(&mut self, avd: String) -> &mut Self

Use a specific android virtual device

Source

pub fn avd_arch(&mut self, avd_arch: String) -> &mut Self

Use a specific target architecture

Source

pub fn skindir(&mut self, skindir: &Path) -> &mut Self

Search skins in

(default /skins)

Source

pub fn skin(&mut self, skin: String) -> &mut Self

Select a given skin

Source

pub fn no_skin(&mut self, no_skin: bool) -> &mut Self

Deprecated: create an AVD with no skin instead

Source

pub fn noskin(&mut self, noskin: bool) -> &mut Self

Same as -no-skin

Source

pub fn memory(&mut self, memory: u32) -> &mut Self

Physical RAM size in MBs

Source

pub fn ui_only(&mut self, ui_only: String) -> &mut Self

Run only the UI feature requested

Source

pub fn id(&mut self, id: String) -> &mut Self

Assign an id to this virtual device (separate from the avd name)

Source

pub fn cores(&mut self, cores: u32) -> &mut Self

Set number of CPU cores to emulator

Source

pub fn accel(&mut self, accel: AccelMode) -> &mut Self

Configure emulation acceleration

Source

pub fn no_accel(&mut self, no_accel: bool) -> &mut Self

Same as ‘-accel off’

Source

pub fn ranchu(&mut self, ranchu: bool) -> &mut Self

Use new emulator backend instead of the classic one

Source

pub fn engine(&mut self, engine: Engine) -> &mut Self

Select engine. auto|classic|qemu2

Source

pub fn netspeed(&mut self, netspeed: Netspeed) -> &mut Self

Maximum network download/upload speeds

Source

pub fn netdelay(&mut self, netdelay: String) -> &mut Self

Network latency emulation

Source

pub fn netfast(&mut self, netfast: bool) -> &mut Self

Disable network shaping

Source

pub fn code_profile(&mut self, code_profile: String) -> &mut Self

Enable code profiling

Source

pub fn show_kernel(&mut self, show_kernel: bool) -> &mut Self

Display kernel messages

Source

pub fn shell(&mut self, shell: bool) -> &mut Self

Enable root shell on current terminal

Source

pub fn no_jni(&mut self, no_jni: bool) -> &mut Self

Deprecated, see dalvik_vm_checkjni

Source

pub fn nojni(&mut self, nojni: bool) -> &mut Self

Deprecated, see dalvik_vm_checkjni

Source

pub fn dalvik_vm_checkjni(&mut self, dalvik_vm_checkjni: bool) -> &mut Self

Enable dalvik.vm.checkjni

Source

pub fn logcat(&mut self, logcat: String) -> &mut Self

Enable logcat output with given tags

Source

pub fn no_audio(&mut self, no_audio: bool) -> &mut Self

Disable audio support

Source

pub fn noaudio(&mut self, noaudio: bool) -> &mut Self

Same as -no-audio

Source

pub fn audio(&mut self, audio: String) -> &mut Self

Use specific audio backend

Source

pub fn radio(&mut self, radio: String) -> &mut Self

Redirect radio modem interface to character device

Source

pub fn port(&mut self, port: String) -> &mut Self

TCP port that will be used for the console

Source

pub fn ports(&mut self, ports: Vec<String>) -> &mut Self

TCP ports used for the console and adb bridge

Source

pub fn onion(&mut self, onion: &Path) -> &mut Self

Use overlay PNG image over screen

Source

pub fn onion_alph(&mut self, onion_alph: String) -> &mut Self

Specify onion-skin translucency

Source

pub fn onion_rotation(&mut self, onion_rotation: String) -> &mut Self

specify onion-skin rotation

Source

pub fn dpi_device(&mut self, dpi_device: String) -> &mut Self

Specify device’s resolution in dpi (default DEFAULT_DEVICE_DPI)

Source

pub fn scale(&mut self, scale: String) -> &mut Self

Scale emulator window (deprecated)

Source

pub fn wifi_client_port(&mut self, wifi_client_port: String) -> &mut Self

Connect to other emulator for WiFi forwarding

Source

pub fn wifi_server_port(&mut self, wifi_server_port: String) -> &mut Self

Listen to other emulator for WiFi forwarding

Source

pub fn http_proxy(&mut self, http_proxy: String) -> &mut Self

Make TCP connections through a HTTP/HTTPS proxy

Source

pub fn timezone(&mut self, timezone: String) -> &mut Self

Use this timezone instead of the host’s default

Source

pub fn change_language(&mut self, change_language: String) -> &mut Self

Use this language instead of the current one. Restarts the framework

Source

pub fn change_country(&mut self, change_country: String) -> &mut Self

Use this country instead of the current one. Restarts the framework

Source

pub fn change_locale(&mut self, change_locale: String) -> &mut Self

Use this locale instead of the current one. Restarts the framework

Source

pub fn dns_server(&mut self, dns_server: String) -> &mut Self

Use this DNS server(s) in the emulated system

Source

pub fn net_tap(&mut self, net_tap: String) -> &mut Self

Use this TAP interface for networking

Source

pub fn net_tap_script_up(&mut self, net_tap_script_up: String) -> &mut Self

Script to run when the TAP interface goes up

Source

pub fn net_tap_script_down(&mut self, net_tap_script_down: String) -> &mut Self

Script to run when the TAP interface goes down

Source

pub fn cpu_delay(&mut self, cpu_delay: String) -> &mut Self

Throttle CPU emulation

Source

pub fn no_boot_anim(&mut self, no_boot_anim: bool) -> &mut Self

Disable animation for faster boot

Source

pub fn no_window(&mut self, no_window: bool) -> &mut Self

Disable graphical window display

Source

pub fn qt_hide_window(&mut self, qt_hide_window: bool) -> &mut Self

Start QT window but hide window display

Source

pub fn no_sim(&mut self, no_sim: bool) -> &mut Self

Device has no SIM card

Source

pub fn lowram(&mut self, lowram: bool) -> &mut Self

Device is a low ram device

Source

pub fn version(&mut self, version: bool) -> &mut Self

Display emulator version number

Source

pub fn no_passive_gps(&mut self, no_passive_gps: bool) -> &mut Self

Disable passive gps updates

Source

pub fn gnss_file_path(&mut self, gnss_file_path: &Path) -> &mut Self

Use the specified filepath to read gnss data

Source

pub fn gnss_grpc_port(&mut self, gnss_grpc_port: String) -> &mut Self

Use the specified port number to start grpc service to receive gnss data

Source

pub fn virtio_console(&mut self, virtio_console: bool) -> &mut Self

Using virtio console as console

Source

pub fn read_only(&mut self, read_only: bool) -> &mut Self

Allow running multiple instances of emulators on the same AVD, but cannot save snapshot

Source

pub fn is_restart(&mut self, is_restart: String) -> &mut Self

Specifies that this emulator was a restart, and to wait out before proceeding

Source

pub fn report_console(&mut self, report_console: String) -> &mut Self

Report console port to remote socket

Source

pub fn gps(&mut self, gps: String) -> &mut Self

Redirect NMEA GPS to character device

Source

pub fn shell_serial(&mut self, shell_serial: String) -> &mut Self

Specific character device for root shell

Source

pub fn tcpdump(&mut self, tcpdump: &Path) -> &mut Self

Capture network packets to file

Source

pub fn bootchart(&mut self, bootchart: String) -> &mut Self

Enable bootcharting

Source

pub fn charmap(&mut self, charmap: &Path) -> &mut Self

Use specific key character map

Source

pub fn studio_params(&mut self, studio_params: &Path) -> &mut Self

Used by Android Studio to provide parameters

Source

pub fn prop(&mut self, prop: String) -> &mut Self

Set system property on boot

Source

pub fn shared_net_id(&mut self, shared_net_id: String) -> &mut Self

Join the shared network, using IP address 10.1.2.

Source

pub fn gpu(&mut self, gpu: String) -> &mut Self

Set hardware OpenGLES emulation mode

Source

pub fn use_host_vulkan(&mut self, use_host_vulkan: bool) -> &mut Self

Use host for vulkan emulation regardless of ‘gpu’ mode

Source

pub fn camera_back(&mut self, camera_back: CameraMode) -> &mut Self

Set emulation mode for a camera facing back

Source

pub fn camera_front(&mut self, camera_front: CameraMode) -> &mut Self

Set emulation mode for a camera facing front

Source

pub fn webcam_list(&mut self, webcam_list: bool) -> &mut Self

Lists web cameras available for emulation

Source

pub fn virtualscene_poster(&mut self, virtualscene_poster: String) -> &mut Self

Load a png or jpeg image as a poster in the virtual scene

Source

pub fn screen(&mut self, screen: ScreenMode) -> &mut Self

Set emulated screen mode

Source

pub fn force_32bit(&mut self, force_32bit: bool) -> &mut Self

Always use 32-bit emulator

Source

pub fn selinux(&mut self, selinux: SELinux) -> &mut Self

Set SELinux to either disabled or permissive mode

Source

pub fn unix_pipe(&mut self, unix_pipe: &Path) -> &mut Self

Add to the list of allowed Unix pipes

Source

pub fn fixed_scale(&mut self, fixed_scale: bool) -> &mut Self

Use fixed 1:1 scale for the initial emulator window

Source

pub fn wait_for_debugger(&mut self, wait_for_debugger: bool) -> &mut Self

Pause on launch and wait for a debugger process to attach before resuming

Source

pub fn skip_adb_auth(&mut self, skip_adb_auth: bool) -> &mut Self

Skip adb authentication dialogue

Source

pub fn metrics_to_console(&mut self, metrics_to_console: bool) -> &mut Self

Enable usage metrics and print the messages to stdout

Source

pub fn metrics_collection(&mut self, metrics_collection: bool) -> &mut Self

Enable usage metrics and send them to google play

Source

pub fn metrics_to_file(&mut self, metrics_to_file: &Path) -> &mut Self

Enable usage metrics and write the messages into specified file

Source

pub fn detect_image_hang(&mut self, detect_image_hang: bool) -> &mut Self

Enable the detection of system image hangs

Source

pub fn feature(&mut self, feature: String) -> &mut Self

Force-enable or disable (-name) the features

Source

pub fn icc_profile(&mut self, icc_profile: &Path) -> &mut Self

Use icc profile from specified file

Source

pub fn sim_access_rules_file( &mut self, sim_access_rules_file: &Path, ) -> &mut Self

Use SIM access rules from specified file

Source

pub fn phone_number(&mut self, phone_number: String) -> &mut Self

Sets the phone number of the emulated device

Source

pub fn acpi_config(&mut self, acpi_config: &Path) -> &mut Self

Specify acpi device proprerties (hierarchical key=value pair)

Source

pub fn fuchsia(&mut self, fuchsia: bool) -> &mut Self

Run Fuchsia image. Bypasses android-specific setup; args after are treated as standard QEMU args

Source

pub fn window_size(&mut self, window_size: String) -> &mut Self

Set window size for when bypassing android-specific setup

Source

pub fn allow_host_audio(&mut self, allow_host_audio: bool) -> &mut Self

Allows sending of audio from audio input devices. Otherwise, zeroes out audio

Source

pub fn restart_when_stalled(&mut self, restart_when_stalled: bool) -> &mut Self

Allows restarting guest when it is stalled

Source

pub fn perf_stat(&mut self, perf_stat: &Path) -> &mut Self

Run periodic perf stat reporter in the background and write output to specified file

Source

pub fn share_vid(&mut self, share_vid: bool) -> &mut Self

Share current video state in shared memory region

Source

pub fn grpc(&mut self, grpc: String) -> &mut Self

TCP ports used for the gRPC bridge

Source

pub fn grpc_tls_key(&mut self, grpc_tls_key: &Path) -> &mut Self

File with the private key used to enable gRPC TLS

Source

pub fn grpc_tls_cer(&mut self, grpc_tls_cer: &Path) -> &mut Self

File with the public X509 certificate used to enable gRPC TLS

Source

pub fn grpc_tls_ca(&mut self, grpc_tls_ca: &Path) -> &mut Self

File with the Certificate Authorities used to validate client certificates

Source

pub fn grpc_use_token(&mut self, grpc_use_token: bool) -> &mut Self

Use the emulator console token for gRPC authentication

Source

pub fn idle_grpc_timeout(&mut self, idle_grpc_timeout: u32) -> &mut Self

Terminate the emulator if there is no gRPC activity within seconds

Source

pub fn waterfall(&mut self, waterfall: String) -> &mut Self

Mode in which to run waterfall

Source

pub fn multidisplay(&mut self, multidisplay: String) -> &mut Self

Config multiple displays

Source

pub fn google_maps_key(&mut self, google_maps_key: String) -> &mut Self

API key to use with the Google Maps GUI

Source

pub fn no_location_ui(&mut self, no_location_ui: bool) -> &mut Self

Disable the location UI in the extended window

Source

pub fn use_keycode_forwarding( &mut self, use_keycode_forwarding: bool, ) -> &mut Self

Use keycode forwarding instead of host charmap translation

Source

pub fn record_session(&mut self, record_session: &Path) -> &mut Self

Screen record the emulator session

Source

pub fn legacy_fake_camera(&mut self, legacy_fake_camera: bool) -> &mut Self

Use legacy camera HAL for the emulated fake camera

Source

pub fn no_camera_hq_edge(&mut self, no_camera_hq_edge: bool) -> &mut Self

Disable high qualify edge processing for emulated camera

Source

pub fn no_direct_adb(&mut self, no_direct_adb: bool) -> &mut Self

Use external adb executable for internal communication

Source

pub fn check_snapshot_loadable( &mut self, check_snapshot_loadable: String, ) -> &mut Self

Check if a snasphot is loadable

Source

pub fn no_hidpi_scaling(&mut self, no_hidpi_scaling: bool) -> &mut Self

Disable HiDPI scaling of guest display on macOS devices

Source

pub fn no_mouse_reposition(&mut self, no_mouse_reposition: bool) -> &mut Self

Do not reposition the mouse to emulator window center if mouse pointer gets out of the window

Source

pub fn guest_angle(&mut self, guest_angle: bool) -> &mut Self

Enable guest ANGLE as system driver

Source

pub fn qemu(&mut self, qemu: bool) -> &mut Self

Pass arguments to qemu

Source

pub fn verbose(&mut self, verbose: bool) -> &mut Self

Same as ‘-debug-init’

Source

pub fn debug(&mut self, debug: DebugTags) -> &mut Self

Enable/disable debug messages

Source

pub fn debug_no(&mut self, debug_no: DebugTags) -> &mut Self

Source

pub fn help(&mut self, help: bool) -> &mut Self

Print this help

Source

pub fn help_disk_images(&mut self, help_disk_images: bool) -> &mut Self

About disk images

Source

pub fn help_debug_tags(&mut self, help_debug_tags: bool) -> &mut Self

Debug tags for -debug

Source

pub fn help_char_devices(&mut self, help_char_devices: bool) -> &mut Self

Character specification

Source

pub fn help_environment(&mut self, help_environment: bool) -> &mut Self

Environment variables

Source

pub fn help_virtual_device(&mut self, help_virtual_device: bool) -> &mut Self

Virtual device management

Source

pub fn help_sdk_images(&mut self, help_sdk_images: bool) -> &mut Self

About disk images when using the SDK

Source

pub fn help_build_images(&mut self, help_build_images: bool) -> &mut Self

About disk images when building Android

Source

pub fn help_all(&mut self, help_all: bool) -> &mut Self

Prints all help content

Source

pub fn run(&self) -> Result<()>

Runs emulator commands and initialize emulator

Trait Implementations§

Source§

impl Clone for EmulatorTools

Source§

fn clone(&self) -> EmulatorTools

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for EmulatorTools

Source§

fn default() -> EmulatorTools

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.