Is there a quick way to synchronize two (or more) targets in Xcode? This becomes an issue when I forget to add a new file to my unit test & integration target. Then I have to go hunting to see what I forgot to add. I can duplicate my “development” target and then re-add the “unit testing” configuration, but that’s a pain. Is there an easier way?
EDIT:
I like John’s answer below but ultimately I used the answer from here, that involves manually editing the project file. With multiple missing files that was the quickest way.
your question focuses on the case where you are adding a single file to a target, and forget to check both boxes to add it to the target you want.
perhaps you mean that it is a pain to use the identity inspector, but i think this is a handy way to add in one file that i didn’t properly get added to a second target. you can get to the identity inspector by first clicking on the file for which you want to inspect information, and then using Cmd-Opt-1, and then clicking the rightmost tab. notice near the bottom that for me, both targets are checked. for you, in the case of a file that didn’t get added to both targets, one will be unchecked.
in the case of not remembering which files you added recently to a target:
-> “Version Editor” -> “Show Version Editor” (or Cmd-Opt-Shift-Return), and you’ll get a text-based diff comparison of
the XML representing your project versus what it looked like at the
last commit. whatever is new is likely the set of files to look at
for the checkboxes as in the picture above.
control, you may have to go through the files one by one, though you
might be able to use the finder to sort your source by Date Modified,
and jog your memory as to the file you added, then go straight to
that. in terms of going through one by one, once the identity inspector
is open, you should be able to just click on the first file in the list,
then use the down-arrow to step through all files, and see which are in
the desired set of targets and which are not.