pub struct AdbServer { /* private fields */ }Expand description
ADB server connection for device discovery and management.
Implementations§
Source§impl AdbServer
impl AdbServer
Sourcepub fn new(host: impl Into<String>, port: u16) -> Self
pub fn new(host: impl Into<String>, port: u16) -> Self
Create a server connection with custom address.
Sourcepub async fn devices(&self) -> Result<Vec<DeviceInfo>>
pub async fn devices(&self) -> Result<Vec<DeviceInfo>>
List all connected devices.
Sourcepub async fn device_by_serial(&self, serial: &str) -> Result<AdbDevice>
pub async fn device_by_serial(&self, serial: &str) -> Result<AdbDevice>
Get a handle to a specific device by serial.
Sourcepub async fn resolve_device(&self, serial: Option<&str>) -> Result<AdbDevice>
pub async fn resolve_device(&self, serial: Option<&str>) -> Result<AdbDevice>
Get a device — by serial if provided, otherwise the first available.
Sourcepub async fn server_kill(&self) -> Result<()>
pub async fn server_kill(&self) -> Result<()>
Kill the ADB server.
Sourcepub async fn connect_device(&self, addr: &str) -> Result<String>
pub async fn connect_device(&self, addr: &str) -> Result<String>
Connect to a remote device via TCP/IP (adb connect host:port).
Sourcepub async fn disconnect_device(&self, addr: &str) -> Result<String>
pub async fn disconnect_device(&self, addr: &str) -> Result<String>
Disconnect from a remote device (adb disconnect host:port).
Sourcepub async fn wait_for(
&self,
serial: Option<&str>,
state: &str,
timeout: Duration,
) -> Result<()>
pub async fn wait_for( &self, serial: Option<&str>, state: &str, timeout: Duration, ) -> Result<()>
Block until a device reaches the specified state, or time out.
state can be “device”, “recovery”, “bootloader”, etc.
Sourcepub async fn track_devices(&self) -> Result<Receiver<Vec<DeviceEvent>>>
pub async fn track_devices(&self) -> Result<Receiver<Vec<DeviceEvent>>>
Track device connect/disconnect events as an async stream.
Returns an mpsc receiver that yields device state updates. The background task runs until the receiver is dropped.
Sourcepub async fn forward_list_all(&self) -> Result<Vec<ForwardEntry>>
pub async fn forward_list_all(&self) -> Result<Vec<ForwardEntry>>
List port forwards for ALL devices (server-level).
Unlike AdbDevice::forward_list() which filters by serial,
this returns forwards across all connected devices.