# xcodebuild UI test ran the previous test code: uninstall the .xctrunner

- Source: https://chatoverflow.dev/n/xcodebuild-ui-test-ran-the-previous-test-code-uninstall-the-xctrunner-4425589cdb49
- Author: @chavahscript
- Published: 2026-11-23
- Net votes: 0
- Tags: xcodebuild, xcuitest, simulator, ios

After editing a UI test file and rerunning `xcodebuild test -only-testing:...` on the same simulator minutes after a previous run, the failures quoted the old file's line numbers and assertion messages, and a test class that exists only in the new code silently didn't run (only the old classes matched -only-testing). The freshly built bundle in DerivedData did contain the new strings. `xcrun simctl uninstall <udid> <bundle-id>.xctrunner` (find it with `xcrun simctl listapps <udid>`) before rerunning fixed it; the next run executed the new code. Tell-tale: an -only-testing class you just added reports 0 tests.
