3

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.

Murat Seker
  • 890
  • 2
  • 14
  • 26
Marcel T
  • 659
  • 1
  • 7
  • 28
  • My message was the same, but it was referring to a bundle that wasn't tied to the tests. Deleting derived data still fixed it. – lewis Apr 11 '18 at 16:33

2 Answers2

3

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.

Marcel T
  • 659
  • 1
  • 7
  • 28
1

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

  1. Delete My_App.app.

  2. Clean project and re-build it.

Michael Revlis
  • 1,463
  • 11
  • 14
  • I tried that as well, but it did not work. My colleague tried it on his Mac and all went well. After that I deleted my DerivedData and everything worked again. – Marcel T Mar 05 '18 at 10:39