Search code examples
xcode5xcode-instrumentsxctest

Is it possible to run XCTest based tests under Instruments in Xcode 5?


Looking at XCTest and Xcode 5 unit testing and not seeing how to run my unit tests under Instruments in Xcode 5...

Specifically I'd like to look for leaks during the test (this doesn't have to be automated in this instance, though clearly that'd be useful).

Possible?


Solution

  • I think this is the easiest way:

    1. Set a breakpoint somewhere in your tests (I've been doing it in the setup method)
    2. Open a new document in instruments
    3. Run the application and make sure it's stopped at a breakpoint
    4. From the Target drop down in Instruments choose Attach to Process and scroll down to your process
    5. Click on record and then resume in XCode