Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 9 UITest not working

I try to develop an UI Unit Test for my Application. I created a UI Test Target and wanted to launch the example XCTest which is generated with the creation of the Target.

When I try to launch the Test I get the error message:

Could not obtain the Bundle Identifier for /Path/from/user/toAppRepo/build/Debug-iphonesimulator/My_App.app

I am not sure, why this is happening, as I did not change Andy configuration and several Questions I have seen here do not help with my Problem, e.g. I set the Buildings "Use for command-line builds" option to "Debug" as mentioned in a similar Question. When I set TEST_HOSTit says, that I could not configure a Test with USE_XCTRUNNER and TEST_HOST.

like image 462
Marcel T Avatar asked Mar 13 '26 06:03

Marcel T


2 Answers

I tried multiple solutions on this now like, cleaning the project adjusting the project file or deleting the app etc., but nothing helped here.

After discussions with my colleague where everything worked very well (same project) I tried to delete my DerivedData of Xcode with following terminal command:

rm -rf ~/Library/Developer/Xcode/DerivedData

After that I tried to launch the test again and everything worked. Probably there are multiple issues which lead to this error all with a different solution and this was mine. Hope it helps someone which has the same issue.

like image 170
Marcel T Avatar answered Mar 15 '26 13:03

Marcel T


I encountered a similar problem and the way I fix it is

  1. Delete My_App.app.

  2. Clean project and re-build it.

like image 39
Michael Revlis Avatar answered Mar 15 '26 12:03

Michael Revlis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!