pub trait ADBDeviceExt {
// Required methods
fn shell_command(
&mut self,
command: &[&str],
output: &mut dyn Write,
) -> Result<()>;
fn shell(
&mut self,
reader: &mut dyn Read,
writer: Box<dyn Write + Send>,
) -> Result<()>;
fn stat(&mut self, remote_path: &str) -> Result<AdbStatResponse>;
fn pull(
&mut self,
source: &dyn AsRef<str>,
output: &mut dyn Write,
) -> Result<()>;
fn push(
&mut self,
stream: &mut dyn Read,
path: &dyn AsRef<str>,
) -> Result<()>;
fn reboot(&mut self, reboot_type: RebootType) -> Result<()>;
fn install(&mut self, apk_path: &dyn AsRef<Path>) -> Result<()>;
fn framebuffer_inner(&mut self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>>;
// Provided methods
fn run_activity(&mut self, package: &str, activity: &str) -> Result<Vec<u8>> { ... }
fn framebuffer(&mut self, path: &dyn AsRef<Path>) -> Result<()> { ... }
fn framebuffer_bytes(&mut self) -> Result<Vec<u8>> { ... }
fn boxed(self) -> Box<dyn ADBDeviceExt>
where Self: Sized + 'static { ... }
}
Expand description
Trait representing all features available on both crate::ADBServerDevice
and crate::ADBUSBDevice
Required Methods§
Sourcefn shell_command(
&mut self,
command: &[&str],
output: &mut dyn Write,
) -> Result<()>
fn shell_command( &mut self, command: &[&str], output: &mut dyn Write, ) -> Result<()>
Runs command in a shell on the device, and write its output and error streams into output.
Sourcefn shell(
&mut self,
reader: &mut dyn Read,
writer: Box<dyn Write + Send>,
) -> Result<()>
fn shell( &mut self, reader: &mut dyn Read, writer: Box<dyn Write + Send>, ) -> Result<()>
Starts an interactive shell session on the device. Input data is read from reader and write to writer.
Sourcefn stat(&mut self, remote_path: &str) -> Result<AdbStatResponse>
fn stat(&mut self, remote_path: &str) -> Result<AdbStatResponse>
Display the stat information for a remote file
Sourcefn pull(
&mut self,
source: &dyn AsRef<str>,
output: &mut dyn Write,
) -> Result<()>
fn pull( &mut self, source: &dyn AsRef<str>, output: &mut dyn Write, ) -> Result<()>
Pull the remote file pointed to by source
and write its contents into output
Sourcefn push(&mut self, stream: &mut dyn Read, path: &dyn AsRef<str>) -> Result<()>
fn push(&mut self, stream: &mut dyn Read, path: &dyn AsRef<str>) -> Result<()>
Push stream
to path
on the device.
Sourcefn reboot(&mut self, reboot_type: RebootType) -> Result<()>
fn reboot(&mut self, reboot_type: RebootType) -> Result<()>
Reboot the device using given reboot type
Sourcefn install(&mut self, apk_path: &dyn AsRef<Path>) -> Result<()>
fn install(&mut self, apk_path: &dyn AsRef<Path>) -> Result<()>
Install an APK pointed to by apk_path
on device.
Sourcefn framebuffer_inner(&mut self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>>
fn framebuffer_inner(&mut self) -> Result<ImageBuffer<Rgba<u8>, Vec<u8>>>
Inner method requesting framebuffer from an Android device
Provided Methods§
Sourcefn run_activity(&mut self, package: &str, activity: &str) -> Result<Vec<u8>>
fn run_activity(&mut self, package: &str, activity: &str) -> Result<Vec<u8>>
Run activity
from package
on device. Return the command output.
Sourcefn framebuffer(&mut self, path: &dyn AsRef<Path>) -> Result<()>
fn framebuffer(&mut self, path: &dyn AsRef<Path>) -> Result<()>
Dump framebuffer of this device into given path
Sourcefn framebuffer_bytes(&mut self) -> Result<Vec<u8>>
fn framebuffer_bytes(&mut self) -> Result<Vec<u8>>
Dump framebuffer of this device and return corresponding bytes.
Output data format is currently only PNG
.
Sourcefn boxed(self) -> Box<dyn ADBDeviceExt>where
Self: Sized + 'static,
fn boxed(self) -> Box<dyn ADBDeviceExt>where
Self: Sized + 'static,
Return a boxed instance representing this trait