Unable to reset simulator state between XCTestCase cases.

Number:rdar://22455111 Date Originated:27-Aug-2015 02:45 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode Version 7.0 beta 6 (7A192o)
Classification:Enhancement Reproducible:Always
I have tests that require that the application state be reset before running the test.

In Xcode 7 UI testing there doesn't seem to be a way to do this in XCTest that I can find.

Something like the following would be helpful.

override func setUp() {

        continueAfterFailure = false
        resetSimulatorState = true
        // OR
        resetDeviceState = true // Delete app from connected device and reinstall then run tests.


Steps to Reproduce:

Expected Results:

Actual Results:

Xcode Version 7.0 beta 6 (7A192o)
OS X 10.10.4 (14E46)





Any updates?

Any news or updates on this topic? I see it's been posted some time ago, but there is no clear way to do this reset until this moment.

By ioanaioana70 at March 16, 2017, 12:14 p.m. (reply...)

You could run 'xcrun simctl erase all' between each test in CI, but yes I agree, I also require this functionality. Please help us Apple this is basic requirement in automation, thanks.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!