2

I have tried every single suggestion in the links below, without any solution. (XCODE 5.0.1)

Solution 1

Solution 2

d: file not found: /Users/hooman/Library/Developer/Xcode/DerivedData/F11i-erlvxsqudsegbmckzxfxnvnxxumb/Build/Products/Debug-iphonesimulator/F11i.app/F11i
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The strange part is, when I look at this path:

/Users/hooman/Library/Developer/Xcode/DerivedData/F11i-erlvxsqudsegbmckzxfxnvnxxumb/Build/Products/Debug-iphonesimulator/

I see two files with a different name of the project (which I believe was the former name):

F09.app

F09.app.dSYM

but XCODE seems to be looking after

F11i.app

F11i.app.dSYM

Where in XCODE can I set these names so that it compiles again? (I checked git, and the project file is reverted, there is nothing else that could have affected this)

Many Thanks

Community
  • 1
  • 1
Houman
  • 64,245
  • 87
  • 278
  • 460
  • 1
    And which one is the right one? Or none? Did you set a "target" of the Unit Test bundle? Note: if a target is set, this will cause Xcode to execute the target and inject Unit Test code into the target's executable. You may also set the target to "None", in which case only compiled modules and explicitly linked libraries will be part of the Unit Test application. – CouchDeveloper Nov 04 '13 at 09:49
  • 1
    Thanks for your help. I usually set the target for the affected files manually. Where in XCODE can I check how the "target" of the entire Unittest bundle is set? (Regarding the naming, it seems my colleague has the same as I have, and it works for him, so it must be something else) – Houman Nov 04 '13 at 09:59
  • 1
    You can set the "target" of a Unit Test bundle in the "General" tab of the target editor. (select project in left hand navigation area, select the unit test target in the target editor, select "General" tab, select a target from the popup, or "None".) – CouchDeveloper Nov 04 '13 at 10:03
  • 1
    ahhh yes. I just found it. Thank you so much. It fixed it. Literally setting it to None, fixed the problem. I didn't see this option before. hey really appreciated! Please put it as an answer and I tick it off. – Houman Nov 04 '13 at 10:04
  • 2
    Note: you possibly need to adjust these settings as well: 1) In the Scheme Editor (select Project, then command Product->Scheme->"YourProject"), select the "Build" scheme, check whether the corresponding Unit Test target is included in the "Targets" list. Check also that the check mark "Test" is set for the Unit Test's target. 2) In the target editor, select the Unit Test, select "Build Phases" tab. Check if you have added the Unit Test's target as a "target dependency". – CouchDeveloper Nov 04 '13 at 10:12

1 Answers1

4

If you want to build a pure Unit Test which just tests a Class independently of an application where it is used, you usually don't set a "Unit Test" target. In order to build the Unit Test bundle properly, you need to include the module you want to test, and possibly link to any other framework or library that will be needed. This kind of test will run independently of your app.

If you want to test several aspects of the application, you can set a "Unit Test target". This builds the application executable, and then the test bundle containing only unit test code. During the test, the "test code" will be "injected" into the application executable. Note that this kind of test will start your application.

You can set the "target" of a Unit Test bundle in the "General" tab of the target editor:

Select project in left hand navigation area, select the unit test target in the target editor, select "General" tab, select a target from the popup, or "None".

If you want to inject unit test code into a running application, you possibly need to adjust these settings as well (note: Xcode will setup this as default already):

  1. Open the Scheme Editor: Select Project, then command Product -> Scheme -> "YourProject".

    Then, select the "Build" scheme, check whether the corresponding Unit Test target is included in the "Targets" list. Check also that the check mark "Test" is set for the Unit Test's target.

  2. In the target editor, select the Unit Test, select "Build Phases" tab. Check if you have added the Unit Test's target as a "target dependency".

CouchDeveloper
  • 18,174
  • 3
  • 45
  • 67