Question

Okay, here's a little bit of context:

I have just added a Mac OS Core Data Command Line Tool target to my iOS project. It's purpose is to simply use my iOS app's Core Data model and a JSON file (which I am adding default data to as I go) to create an SQLite database which I am going to use as the default database for my iOS app. The idea is to have this command line tool ready in my project so that when I add some default data to my JSON file, I just:

  1. Run the command line tool
  2. Go to products in the file navigator on the left
  3. Control click the command line tool product and hit show in finder
  4. Drag the .sqlite database that has been displayed along with all the other bundled files for my command line tool and drop it into my iOS app's resources

But, I can't do this because the command line tool product is showing red in the navigator window because Xcode is looking for it at this path:

/Users/kylejm/Library/Developer/Xcode/DerivedData/MyiOSApp-ggjlxrqiijmbqkgkucdargamkwld/Build/Products/Debug-iphoneos/

Where as the it is actually in:

/Users/kylejm/Library/Developer/Xcode/DerivedData/MyiOSApp-ggjlxrqiijmbqkgkucdargamkwld/Build/Products/Debug/

I have been inspecting the Build Locations in the Build Settings but all the resolved paths are correct for both my iOS app and the command line tool respectively.

What do I need to do to make Xcode look in the right place?

Thanks so much for any help in advance.


I just clarified my scenario/problem for the answer by bauerMusic like so:

Thanks for your answer but I don't think you quite understand my scenario or problem. The Command Line Tool (CLT) target is a part of my project, and therefore has a executable product in the product folder (shown in red until first build and run). When I run this command line tool, it's product in the products folder remains red because Xcode is looking for the product in the wrong place for it.

I've put it in the description so you all understand my question as clearly as possible.

No correct solution

OTHER TIPS

You usually never add files to a project outside of Xcode, (meaning, simply place it in the folder) unless you want to have these sort of issues.

Try to remove it, restart the project (build and see that it has no broken links warnings), and drag the file to the navigator's folder in your open Xcode project.

Edit: Just to be clear, add through Xcode, not the Finder. Xcode should prompt you to either copy resource or not (check box).

I was going to suggest you Clean the project, but I then noticed how you actually added the file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top