pub struct Session {
pub udid: String,
pub config: Config,
pub tunnel: Option<Tunnel>,
pub ax: Option<AxSub>,
pub input: Option<InputSession>,
pub connects: u64,
pub ax_restarts: u64,
pub dnd: State,
/* private fields */
}Fields§
§udid: String§config: Config§tunnel: Option<Tunnel>§ax: Option<AxSub>§input: Option<InputSession>§connects: u64Counts tunnel (re)connections, for iph doctor and logs.
ax_restarts: u64How often, and when last, the phone’s accessibility daemon was ended because it had stopped answering.
dnd: StateDo Not Disturb: whether it is on for this session and what to put back.
Implementations§
Source§impl Session
impl Session
pub async fn cmd_read(&mut self, args: ReadArgs) -> Res
pub async fn cmd_find(&mut self, args: FindArgs) -> Res
pub async fn cmd_tap(&mut self, args: TapArgs) -> Res
pub async fn cmd_swipe(&mut self, args: SwipeArgs) -> Res
pub async fn cmd_scroll(&mut self, args: ScrollArgs) -> Res
pub async fn cmd_key(&mut self, args: KeyArgs) -> Res
pub async fn cmd_apps(&mut self) -> Res
pub async fn cmd_launch(&mut self, args: LaunchArgs) -> Res
pub async fn cmd_screenshot(&mut self, args: ScreenshotArgs) -> Res
pub async fn cmd_type(&mut self, args: TypeArgs) -> Res
Source§impl Session
impl Session
pub fn new(udid: String, config: Config) -> Self
pub fn invalidate_readings(&mut self)
Sourcepub async fn service_port(&mut self, name: &str) -> Res<(AdapterHandle, u16)>
pub async fn service_port(&mut self, name: &str) -> Res<(AdapterHandle, u16)>
Port of an RSD service, for connections made outside &mut self.
Sourcepub fn drop_input(&mut self)
pub fn drop_input(&mut self)
Abandon the input session without the orderly close (after an error).
Sourcepub async fn sweep(&mut self)
pub async fn sweep(&mut self)
Tell the phone to stop the streams of abandoned input sessions. Left alone they keep the phone encoding, and after a row of timeouts (2026-11-11, with the Mac overloaded) the phone answered ever slower.
pub fn connection(&self) -> Option<&str>
pub async fn ensure_tunnel(&mut self) -> Res<&mut Tunnel>
Sourcepub async fn dump(&mut self, fresh: Fresh, full: bool) -> Res<(u64, Arc<Dump>)>
pub async fn dump(&mut self, fresh: Fresh, full: bool) -> Res<(u64, Arc<Dump>)>
One reading of the screen as the raw dump plus its sequence number.
full waits for the second pass (identifiers).
pub async fn screen( &mut self, fresh: Fresh, full: bool, opts: BuildOptions, ) -> Res<(u64, Screen)>
Sourcepub async fn ensure_input(&mut self) -> Res<&mut InputSession>
pub async fn ensure_input(&mut self) -> Res<&mut InputSession>
Open the input session if needed. Fails with not_sent: nothing has
been written to the phone when this returns an error.
Sourcepub async fn send_gesture(&mut self, gesture: Gesture) -> Res<()>
pub async fn send_gesture(&mut self, gesture: Gesture) -> Res<()>
Send one gesture. The phone sometimes closes the input connections on its own (it answers the next report with a reset, seen 2026-11-11); iph only finds out when it writes. When that write fails before a single report went out, nothing reached the phone, so a new session is opened and the gesture is sent once more. A gesture that failed halfway is never repeated.
Sourcepub async fn close_idle_input(&mut self)
pub async fn close_idle_input(&mut self)
Close the input session when it has not been used for a while; the media stream keeps the phone encoding video.
Sourcepub async fn close_input(&mut self)
pub async fn close_input(&mut self)
End the input session now.
Sourcepub async fn close_input_if_unheld(&mut self)
pub async fn close_input_if_unheld(&mut self)
With input_idle_secs = 0 the input session ends with each command,
so the phone shows “screen sharing” only while input is being sent.
For apps that hide their content or complain while the screen is
shared. Every input then pays for a new session (3 to 4 s).