title: How to launch system apps in an iOS Xcode UI test case
body: <p>I've got an app whose main purpose is to enter data into HealthKit. I'd like to write some Xcode UI tests to verify that it's writing this data successfully, but I'm having some difficulty verifying the data in the Health app.</p>
  
  <p>When I initially recorded my test, it skipped my simulated Home button press, but it was recording as I swiped over to the first home screen and navigated into the Health app to show the data points.</p>
  
  <p>I searched for how to press the Home button, and found this (which works):</p>
  
  <pre><code>XCUIDevice.shared.press(.home)
  </code></pre>
  
  <p>However, none of the other calls it recorded actually work for navigation outside of the app. The recorded code for swiping on the home screen obviously looks wrong, and also doesn't work when I replace <code>tap()</code> with a <code>swipeRight()</code> or <code>swipeLeft()</code>:</p>
  
  <pre><code>app.childrenMatchingType(.Window).elementBoundByIndex(1).childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other).element.childrenMatchingType(.Other).element.childrenMatchingType(.Other).elementBoundByIndex(0).childrenMatchingType(.ScrollView).element.tap()
  </code></pre>
  
  <p>The next couple of lines, for launching an app on the home screen, don't even work for an app icon that's on the currently visible page:</p>
  
  <pre><code>let elementsQuery = app.scrollViews.otherElements
  elementsQuery.icons["Health"].tap()
  </code></pre>
  
  <p>Is there any way to achieve what I'm trying to do, or will I need to wait to verify end-to-end testing until I add the ability to read from HealthKit to my app?</p>