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 184 forks source link

`runwda` does not work on ios 16 w/ 1.0.151 #512

Closed eyJhb closed 1 week ago

eyJhb commented 2 weeks ago

Describe the bug Using go-ios runwda, it will just hang forever and not show the webdriveragent running.

To Reproduce

  1. Have iPhone w/ ios 16
  2. go-ios image auto
  3. go-ios runwda

Expected behavior I expect it to show the "webdriver agent running" message, but instead it doesn't show up, and the command just hangs with no progress.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context It seems to work just fine an v1.0.150, but not v1.0.151 (or latest commit), I suspect that #506 broke it, but I'm not entirely sure why. @dmissmann do you have any ideas?

Logs

{"level":"warning","msg":"go-ios agent is not running. You might need to start it with 'ios tunnel start' for ios17+. Use ENABLE_GO_IOS_AGENT=yes for experimental daemon mode.","time":"2024-11-12T13:30:52+01:00"}
{"level":"info","msg":"no udid specified using first device in list","time":"2024-11-12T13:30:52+01:00","udid":"<UUID>"}
{"level":"warning","msg":"failed to get tunnel info","time":"2024-11-12T13:30:52+01:00","udid":"<UUID>"}
{"bundleid":"com.facebook.WebDriverAgentRunner.xctrunner","level":"info","msg":"Running wda","testbundleid":"com.facebook.WebDriverAgentRunner.xctrunner","time":"2024-11-12T13:30:52+01:00","xctestconfig":"WebDriverAgentRunner.xctest"}
{"bundleID":"com.facebook.WebDriverAgentRunner.xctrunner","channel_id":"com.apple.instruments.server.services.processcontrol","level":"info","msg":"Launching process","time":"2024-11-12T13:30:54+01:00"}
{"channel_id":"com.apple.instruments.server.services.processcontrol","level":"info","msg":"Process started successfully","pid":553,"time":"2024-11-12T13:30:54+01:00"}
{"fields.msg":"2024-11-12 13:30:54.453566+0100 WebDriverAgentRunner-Runner[553:11690] [Default] Running tests...\n","fields.time":26033264458,"level":"info","msg":"outputReceived:fromProcess:atTime:","pid":553,"time":"2024-11-12T13:30:54+01:00"}
{"fields.msg":"2024-11-12 13:40:55.070541+0100 WebDriverAgentRunner-Runner[553:11690] [Default] Failed to retrieve test configuration from IDE. Exiting. Error: Error Domain=com.apple.dt.XCTest.XCTFuture Code=1000 \"Timed out while requesting test configuration.\" UserInfo={NSLocalizedDescription=Timed out while requesting test configuration.}\n","fields.time":40448067465,"level":"info","msg":"outputReceived:fromProcess:atTime:","pid":553,"time":"2024-11-12T13:40:55+01:00"}
{"error":"EOF","level":"error","msg":"conn2 closed unexpectedly","time":"2024-11-12T13:40:55+01:00"}
{"level":"info","msg":"Killing test runner with pid 553 ...","time":"2024-11-12T13:40:55+01:00"}
{"level":"info","msg":"Test runner killed with success","time":"2024-11-12T13:40:55+01:00"}
{"error":"Dispatch: NSKeyedArchiver Unsupported object: '%!s(plist.UID=3)' of type:plist.UID\ngoroutine 67 [running]:\nruntime/debug.Stack()\n\t/nix/store/jyhpd4hgq672bm4m4s1r25zm1bx8vd44-go-1.23.2/share/go/src/runtime/debug/stack.go:26 +0x5e\ngithub.com/danielpaulus/go-ios/ios/testmanagerd.proxyDispatcher.Dispatch.func1()\n\t/tmp/go-ios/ios/testmanagerd/proxydispatcher.go:25 +0x3d\npanic({0xc16cc0?, 0xc0007f2920?})\n\t/nix/store/jyhpd4hgq672bm4m4s1r25zm1bx8vd44-go-1.23.2/share/go/src/runtime/panic.go:785 +0x132\ngithub.com/danielpaulus/go-ios/ios/nskeyedarchiver.archive({0xbdc4a0, 0x1451b38}, {0xc0007af580, 0x3, 0x4})\n\t/tmp/go-ios/ios/nskeyedarchiver/archiver.go:83 +0x3f4\ngithub.com/danielpaulus/go-ios/ios/nskeyedarchiver.archiveXcTestConfiguration({0xc52e20?, 0xc0006c1290}, {0xc0007f2910?, 0x1, 0x30?})\n\t/tmp/go-ios/ios/nskeyedarchiver/objectivec_classes.go:245 +0x5a6\ngithub.com/danielpaulus/go-ios/ios/nskeyedarchiver.archive({0xc52e20, 0xc0006c1290}, {0xc0007f2910, 0x1, 0x1})\n\t/tmp/go-ios/ios/nskeyedarchiver/archiver.go:80 +0x20d\ngithub.com/danielpaulus/go-ios/ios/nskeyedarchiver.archiveObject({0xc52e20, 0xc0006c1290})\n\t/tmp/go-ios/ios/nskeyedarchiver/archiver.go:38 +0x505\ngithub.com/danielpaulus/go-ios/ios/nskeyedarchiver.ArchiveBin({0xc52e20?, 0xc0006c1290?})\n\t/tmp/go-ios/ios/nskeyedarchiver/archiver.go:26 +0x1d\ngithub.com/danielpaulus/go-ios/ios/testmanagerd.proxyDispatcher.Dispatch({0xc00050f180, 0xc000725ea0, 0xc0006c7b80, {0x0, _}, _}, {0x1, 0x0, 0x2c9, 0x6, ...})\n\t/tmp/go-ios/ios/testmanagerd/proxydispatcher.go:47 +0x85b\ngithub.com/danielpaulus/go-ios/ios/dtx_codec.(*Channel).Dispatch(0xc00060c420, {0x1, 0x0, 0x2c9, 0x6, 0x0, 0x1, 0x1, {0x2, 0x208, ...}, ...})\n\t/tmp/go-ios/ios/dtx_codec/channel.go:182 +0x9d9\ngithub.com/danielpaulus/go-ios/ios/dtx_codec.reader(0xc0006c7b80)\n\t/tmp/go-ios/ios/dtx_codec/connection.go:185 +0x2bb\ncreated by github.com/danielpaulus/go-ios/ios/dtx_codec.newDtxConnection in goroutine 9\n\t/tmp/go-ios/ios/dtx_codec/connection.go:158 +0x285\n","level":"error","msg":"Failed running WDA","time":"2024-11-12T13:40:55+01:00"}
stoktamisoglu commented 1 week ago

This is what we experienced with 1.0.151 and later. @dmissmann could you please look at it and see if #506 might introduce it?

eyJhb commented 1 week ago

This is what we experienced with 1.0.151 and later. @dmissmann could you please look at it and see if #506 might introduce it?

I did a git bisect, and it came back to that exact commit. So maybe I should have been more accurate in my wording. it IS that PR that caused it :)

dmissmann commented 1 week ago

I was also able to reproduce it on that version, but it puzzles me what went wrong there, apart from passing the device version around, that https://github.com/danielpaulus/go-ios/pull/506/files#diff-e348e1ae1ad9e1ba778331d17a3d441b29d905189a3ade020a763f9b75d9f0e9R124-R128 should be the only change, and for iOS 16 the value is identical to what was there before 🤯 I'll have another look tomorrow

Selahattinn commented 1 week ago

I was also able to reproduce it on that version, but it puzzles me what went wrong there, apart from passing the device version around, that https://github.com/danielpaulus/go-ios/pull/506/files#diff-e348e1ae1ad9e1ba778331d17a3d441b29d905189a3ade020a763f9b75d9f0e9R124-R128 should be the only change, and for iOS 16 the value is identical to what was there before 🤯 I'll have another look tomorrow

Waiting good news 👍

eyJhb commented 1 week ago

I'll test the new release tomorrow at work :) Thanks!