Getting error in XCUIApplication.launch() after deleting app between tests using Springboard.

Getting error in XCUIApplication.launch() after deleting app between tests using Springboard.

I created about 20 UI tests in a few different files. Every time a test ends I delete the app from the device using Springboard in the tear down func. When I execute one test at the time everything works fine and without any problems. But when I execute the whole testplan or all tests from one file I always get an error after the first time as soon as I try to launch the second test. 

This is the error I receive every time:

Failed to create directory on device 'iPhone' (device identifier) to hold runtime profiles for application with bundle ID ‚bundle ID': No matching application with bundle identifier ‚bundle ID'

Domain: IDEFoundationErrorDomain

Code: 17

User Info: {

    DVTErrorCreationDateKey = "2022-06-30 11:42:41 +0000";

    IDERunOperationFailingWorker = IDELaunchiPhoneLauncher;

}

My Springboard class looks like this 

Setup looks like this 

Tear down looks like this 

The error always occurs in the setUpWithError func on line app.launch().

Does anyone know how to solve this problem?  Thanks in advance for any help or answers.

best regards Stefan

I am also facing the above issue. Is there a solution or update on this?

Hello!

As far as I am aware, XCTest does not reinstall any application between test runs. An install would only happen at the beginning of an entire test suite or plan, if the test was launched manually from Xcode.

Reinstalling your application between each test, test case, or file, is not an expected behavior of XCTest.

If you are looking to create a clean-slate teardown of your app between tests, I would create a tearDown method that clears all user data from your app (using any number of methods) before each test begins.

Getting error in XCUIApplication.launch() after deleting app between tests using Springboard.
 
 
Q