pub struct Device {
pub host: Host,
pub serial: DeviceSerial,
pub adbd_root: bool,
pub is_rooted: bool,
pub su_0_root: bool,
pub su_c_root: bool,
pub run_as_package: Option<String>,
pub storage: AndroidStorage,
pub tempfile: UnixPathBuf,
}
Expand description
Represents an ADB device.
Fields
host: Host
ADB host that controls this device.
serial: DeviceSerial
Serial number uniquely identifying this ADB device.
adbd_root: bool
adb running as root
is_rooted: bool
Flag for rooted device
su_0_root: bool
“su 0” command available
su_c_root: bool
“su -c” command available
run_as_package: Option<String>
storage: AndroidStorage
tempfile: UnixPathBuf
Cache intermediate tempfile name used in pushing via run_as.
Implementations
sourceimpl Device
impl Device
pub fn new(
host: Host,
serial: DeviceSerial,
storage: AndroidStorageInput
) -> Result<Device>
pub fn clear_app_data(&self, package: &str) -> Result<bool>
pub fn create_dir(&self, path: &UnixPath) -> Result<()>
pub fn chmod(&self, path: &UnixPath, mask: &str, recursive: bool) -> Result<()>
pub fn execute_host_command(
&self,
command: &str,
has_output: bool,
has_length: bool
) -> Result<String>
pub fn enable_run_as_for_path(&self, path: &UnixPath) -> bool
pub fn execute_host_shell_command(&self, shell_command: &str) -> Result<String>
pub fn execute_host_shell_command_as(
&self,
shell_command: &str,
enable_run_as: bool
) -> Result<String>
pub fn is_app_installed(&self, package: &str) -> Result<bool>
pub fn launch<T: AsRef<str>>(
&self,
package: &str,
activity: &str,
am_start_args: &[T]
) -> Result<bool>
pub fn force_stop(&self, package: &str) -> Result<()>
pub fn forward_port(&self, local: u16, remote: u16) -> Result<u16>
pub fn kill_forward_port(&self, local: u16) -> Result<()>
pub fn kill_forward_all_ports(&self) -> Result<()>
pub fn reverse_port(&self, remote: u16, local: u16) -> Result<u16>
pub fn kill_reverse_port(&self, remote: u16) -> Result<()>
pub fn kill_reverse_all_ports(&self) -> Result<()>
pub fn list_dir(&self, src: &UnixPath) -> Result<Vec<RemoteDirEntry>>
pub fn path_exists(&self, path: &UnixPath, enable_run_as: bool) -> Result<bool>
pub fn pull(&self, src: &UnixPath, buffer: &mut dyn Write) -> Result<()>
pub fn pull_dir(&self, src: &UnixPath, dest_dir: &Path) -> Result<()>
pub fn push(
&self,
buffer: &mut dyn Read,
dest: &UnixPath,
mode: u32
) -> Result<()>
pub fn push_dir(
&self,
source: &Path,
dest_dir: &UnixPath,
mode: u32
) -> Result<()>
pub fn remove(&self, path: &UnixPath) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more