Search code examples
iosswiftxctestxcode-ui-testingxcuitest

XCUITest interact with elements on Home Screen


While writing my Ui tests I'm trying to interact with elements on iPhone's (Apple Watch's) Home Screen when app under test is running on the background. Is there such ability to do so?


Solution

  • Yes, the home screen is run under the "Springboard" application, which encompasses a lot of system dialogs and popups as well.

    Once on the home screen, you can pull a debug output to see what is available for interaction:

    po XCUIApplication(bundleIdentifier: "com.apple.springboard")