pub struct Device {
pub host: Host,
pub serial: DeviceSerial,
pub run_as_package: Option<String>,
pub storage: AndroidStorage,
pub tempfile: UnixPathBuf,
}Expand description
Represents an ADB device.
Fields§
§host: HostADB host that controls this device.
serial: DeviceSerialSerial number uniquely identifying this ADB device.
run_as_package: Option<String>§storage: AndroidStorage§tempfile: UnixPathBufCache intermediate tempfile name used in pushing via run_as.
Implementations§
Source§impl Device
impl Device
pub async fn new( host: Host, serial: DeviceSerial, storage: AndroidStorageInput, ) -> Result<Device>
pub async fn clear_app_data(&self, package: &str) -> Result<bool>
pub async fn create_dir(&self, path: &UnixPath) -> Result<()>
pub async fn chmod( &self, path: &UnixPath, mask: &str, recursive: bool, ) -> Result<()>
pub async fn execute_host_command( &self, command: &str, has_output: bool, has_length: bool, ) -> Result<Vec<u8>>
pub async fn execute_host_command_to_string( &self, command: &str, has_output: bool, has_length: bool, ) -> Result<String>
pub fn enable_run_as_for_path(&self, path: &UnixPath) -> bool
pub async fn execute_host_shell_command( &self, shell_command: &str, ) -> Result<String>
pub async fn execute_host_exec_out_command( &self, shell_command: &str, ) -> Result<Vec<u8>>
pub async fn execute_host_shell_command_as( &self, shell_command: &str, enable_run_as: bool, ) -> Result<String>
pub async fn is_app_installed(&self, package: &str) -> Result<bool>
pub async fn launch<T: AsRef<str>>( &self, package: &str, activity: &str, am_start_args: &[T], ) -> Result<bool>
pub async fn force_stop(&self, package: &str) -> Result<()>
pub async fn forward_port(&self, local: u16, remote: u16) -> Result<u16>
pub async fn kill_forward_port(&self, local: u16) -> Result<()>
pub async fn kill_forward_all_ports(&self) -> Result<()>
pub async fn reverse_port(&self, remote: u16, local: u16) -> Result<u16>
pub async fn kill_reverse_port(&self, remote: u16) -> Result<()>
pub async fn kill_reverse_all_ports(&self) -> Result<()>
pub async fn list_dir(&self, src: &UnixPath) -> Result<Vec<RemoteDirEntry>>
pub async fn path_exists( &self, path: &UnixPath, enable_run_as: bool, ) -> Result<bool>
pub async fn pull<W: AsyncWrite + Unpin>( &self, src: &UnixPath, buffer: &mut W, ) -> Result<()>
pub async fn pull_dir(&self, src: &UnixPath, dest_dir: &Path) -> Result<()>
pub async fn push<R: AsyncRead + Unpin>( &self, buffer: &mut R, dest: &UnixPath, mode: u32, ) -> Result<()>
pub async fn push_dir( &self, source: &Path, dest_dir: &UnixPath, mode: u32, ) -> Result<()>
pub async fn remove(&self, path: &UnixPath) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more