Search code examples
iosswiftxcodexcode-ui-testingxcode10

How to hit a breakpoint in application while running UI test in iOS?


We have an iOS application for which we have written XCUI tests. We need to debug the iOS application while the test is running to capture some data. But breakpoints set in the application are never hit. Only the breakpoints in the test target gets hit. Is it not possible to debug the application while the ui tests are running it? Any solution?

Thanks, Reshma


Solution

  • Select your test scheme and go to Edit Scheme...

    Select 'Test' in the sidebar and in the 'Info' category check the 'Debug executable' option.

    When you run the tests in that scheme, breakpoints in both the test target and the app under test will be hit.