danielpaulus / go-ios

This is an operating system independent implementation of iOS device features. You can run UI tests, launch or kill apps, install apps etc. with it.
MIT License
964 stars 182 forks source link

Issue running tests on freshly rebooted iOS 17+ device #442

Open shamanec opened 3 months ago

shamanec commented 3 months ago

Describe the bug If a freshly rebooted device is connected to host while tunnel is already running, runtest fails

To Reproduce Steps to reproduce the behavior:

  1. Disconnect your iOS 17+ device
  2. Reboot your device
  3. Start a tunnel with ios tunnel start --userspace
  4. Connect the device - notice that the tunnel registers the new connection
  5. Execute ios runtest --bundle-id={bundleId} --test-runner-bundle-id={bundleId} --xctest-config={config} --udid={udid}
  6. Observe the error:
    {"channel_id":"dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface","error":"Timed out waiting for response for message:5 channel:0","level":"error","msg":"failed requesting channel","time":"2024-08-02T17:22:37+03:00"} {"level":"error","msg":"DeviceConnection failed writing 1297 bytes, only 0 sent","time":"2024-08-02T17:22:37+03:00"} {"level":"error","msg":"Failed sending: write tcp 127.0.0.1:61169-\u003e127.0.0.1:60108: write: broken pipe","time":"2024-08-02T17:22:37+03:00"} {"channel_id":"dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface","error":"write tcp 127.0.0.1:61169-\u003e127.0.0.1:60108: write: broken pipe","level":"info","methodselector":"_IDE_initiateSessionWithIdentifier:capabilities:","msg":"failed starting invoking method","time":"2024-08-02T17:22:37+03:00"} {"level":"error","msg":"initiateSessionWithIdentifierAndCaps failed: write tcp 127.0.0.1:61169-\u003e127.0.0.1:60108: write: broken pipe","time":"2024-08-02T17:22:37+03:00"} {"error":"runXUITestWithBundleIdsXcode15Ctx: cannot initiate a IDE session: write tcp 127.0.0.1:61169-\u003e127.0.0.1:60108: write: broken pipe","level":"info","msg":"Failed running Xcuitest","time":"2024-08-02T17:22:37+03:00"}

Expected behavior XCUITest should successfully start

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context v1.0.133 Only restarting the tunnel seems to help

Blue-FatMan commented 3 months ago

The same Error I faced. reboot the tunnel can solve the problem.