midas06
midas06

Reputation: 2001

How do I consolidate my Xcode project files?

When I started working on my first app, i assumed dragging files into xcode put them in my project's actual directory. Not so. Apparently Xcode references them all on the desktop.

Is there an easy way to copy all referenced files into the project directory? My desktop is a mess.

Upvotes: 5

Views: 2364

Answers (4)

Ben
Ben

Reputation: 746

Even when you check the "Copy files ..." checkbox when you drag your files in, it's done "When necessary", without telling us when it thinks it's deemed not necessary to copy the files. I'd find that the best way to check if a bundle is self-contained is to compress it to .zip (the entire folder), move it to a temp folder, decompress and then go through all the files, or simply compile and run.

It's amazing that Xcode doesn't have a consolidate function like iTunes does.

Upvotes: 1

Mark Bessey
Mark Bessey

Reputation: 19782

Use the Finder to relocate all the files to where you want them. Then, open your Xcode projects, and for each file that's missing (shown in red), use the Get Info command and edit the path.

Upvotes: 4

nivnad
nivnad

Reputation: 716

There really isn't a straightforward way to do this once you've added the references to the Xcode project. One solution (although tedious and slightly scary) is to remove the references from Xcode and re-drag these files into your project with the "Copy files..." option checked.

Upvotes: 1

Andy White
Andy White

Reputation: 88345

From Xcode, you can right-click the project and select "Add -> Existing files..." When you have selected all your files, click "Add," then select the check box at the top "Copy files..."

Upvotes: 0

Related Questions