Accessibility Completely Broken in Simulator <10.x?

macOS: 10.12.5 (16F73)

Xcode: 8.3.2 (8E2002)
Simulator: 10.0 (SimulatorApp-745.10 CoreSimulator-375.21)

Project: Objective-C for entire app code base; Swift 3 only for UITests


Here's a list of the problems I've encountered over the past day, investigating why some UITests fail in iOS Simulator 9.3, but not in 10.3. Curious to know if anyone else has encountered these and/or knows fixes. Otherwise, it's off to Bug Reporter I go...


  • UITabBar reports back *two* found instances for a unique button label. Logging out the app heirarchy to console shows every tab bar button has two accessibility buttons, one with the localized string label and one with the localization string label. The localization string labels are set in Interface Builder, but if the button title is set *again* manually in viewDidLoad, the localization string is replaced with the localized string, and now *both* gain the localized string as an identifier.
  • Accessibility Inspector flat out does not work with Simulator 9.3? Even just in the Springboard, running Accessibility Inspector does not seem to recognize anything about the Simulator window at all. Simulator 10.3 seems OK. In Accessibility Inspector, selecting my Mac > Simulator as the targer mostly works, but does not provide fine-grained accessibility information (I cannot inspect a button embedded in a view placed in the navigation bar, for example)
  • After hitting a breakpoint in a test, in Simulator 10.3 I can `po someLivingObject` in the console and inspect that XCUIElement's accessibility heirarchy. In Simulator 9.3 this does not work for any object with the error "error: could not build Objective-C module '_SwiftXCTestOverlayShims'
    "
  • Cannot type text into search fields using UITest framework. Code that works in Simulator 10.3 fails to get keyboard focus in Simulator 9.3. Thinking it was, perhaps, some change in APIs from 9.3 to 10.3, I had Xcode record my action in Simulator 9.3 and play it back. The below Xcode-generated code (via recording) fails at line #3 during playback with the error "Neither element nor any descendent has keyboard focus. Element: " Hardware keyboard is disabled, onscreen keyboard is properly displayed, input cursor is flashing and awaiting input, but no dice.
    let searchBarElement = app.navigationBars["SearchView"].otherElements["search-bar"]
    searchBarElement.tap()
    app.typeText("foobar")