Com.apple.instruments.server.services.wireless issues during tests

I’m not sure if this is an issue with Appium, or if it’s something on my end, so I figured I’d ask in Support.

Whenever I’ve executed one test in Safari on an iPhone 5S with iOS 7.1, any following test causes multiple errors related to the “com.apple.instruments.server.services.wireless” service, which throws the following error:

2015-07-17 08:11:33:546 - info: [debug] [INST STDERR] 2015-07-17 10:11:33.545 instruments[3801:114409] Connection peer refused channel request for “com.apple.instruments.server.services.wireless”; channel canceled <DTXChannel: 0x7f9bfe934be0>

This error is repeated many times before Appium kills and relaunches instruments and logs the following:

2015-07-17 08:13:01:517 - warn: Instruments socket client never checked in; timing out (global)
2015-07-17 08:13:01:517 - info: [debug] Killall instruments
2015-07-17 08:13:01:549 - info: [debug] [INSTSERVER] Instruments exited with code null
2015-07-17 08:13:01:550 - info: [debug] Cleaning up after instruments exit
2015-07-17 08:13:01:550 - info: [debug] Not worrying about instruments exit since we’re using SafariLauncher
2015-07-17 08:13:01:550 - info: [debug] [INSTSERVER] Instruments exited with code null
2015-07-17 08:13:01:551 - info: [debug] Killall instruments
2015-07-17 08:13:01:553 - info: [debug] Instruments never checked in
2015-07-17 08:13:01:553 - info: [debug] Attempting to retry launching instruments, this is retry #1
2015-07-17 08:13:01:554 - info: [debug] Killall iOS Simulator
2015-07-17 08:13:06:223 - info: → GET /wd/hub/status {}
2015-07-17 08:13:06:224 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.7”,“revision”:“3b1a3b3ddffa1b74ce39015a7a6d46a55028e32c”},“isShuttingDown”:false},“sessionId”:“5259c05c-e8ba-4db6-8b24-e0a0db5600bc”}
2015-07-17 08:13:06:225 - info: ← GET /wd/hub/status 200 1.470 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.4.7”,“revision”:“3b1a3b3ddffa1b74ce39015a7a6d46a55028e32c”},“isShuttingDown”:false},“sessionId”:“5259c05c-e8ba-4db6-8b24-e0a0db5600bc”}
2015-07-17 08:13:06:560 - info: Launching instruments

Afterwards, the next test sometimes runs fine (though the errors cause slownown in execution time), but in some cases Selenium Grid returns a “Read timeout” after which no subsequent test is able to run until I restart the Appium instance (the session gets hogged and doesn’t close).

I’ve got the following setup:

  • OS X 10.10.4
  • Selenium Grid 2.46
  • Appium 1.4.7
  • Xcode 6.4
  • iPhone 5S running iOS 7.1.2 (haven’t tried a newer iOS version on the same machine yet, but I want to use this machine exclusively for testing on iOS 7)

I’m using Protractor 2.1.0 to run the tests.

Any idea what’s causing this?

Edit: A related issue I’m running into - whenever the “Read timeout” occurs in Selenium Grid on a second test run, the session never closes. Any following tests then return a “Session in progress” error immediately.