Skip to content

Commit d515d46

Browse files
committed
ios: enable network interception on real devices
The real IOSDevice did not implement NetworkInterceptorProvider, so 'mobilecli network listen --device <ios-udid>' failed with 'network interception is not supported'. Add IOSDevice.NetworkInterceptor: it ensures the agent (mapped via the native signing-free loader) and returns the same agentNetwork RPC relay Android and the simulator use — the agent's dispatcher routes network.* to MobileNetwork. Verified end-to-end on iPhone12,1 iOS 26.5.2: 'network listen' maps the agent (483 rebases, 244 binds, 5 classes, 5 categories), the server binds, and network.enable/poll/disable round-trip over the forwarded agent port.
1 parent 8813d6f commit d515d46

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎devices/network.go‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,14 @@ func (s *SimulatorDevice) NetworkInterceptor() (NetworkInterceptable, error) {
9797
}
9898
return agentNetwork{port: port}, nil
9999
}
100+
101+
// NetworkInterceptor maps the agent dylib into the foreground app on a real iOS
102+
// device (signing-free, over the debugserver) and returns a relay to its in-app
103+
// agent. The agent's dispatcher routes network.* RPC to MobileNetwork.
104+
func (d *IOSDevice) NetworkInterceptor() (NetworkInterceptable, error) {
105+
port, err := d.ensureIOSDeviceAgentReady()
106+
if err != nil {
107+
return nil, err
108+
}
109+
return agentNetwork{port: port}, nil
110+
}

0 commit comments

Comments
 (0)