AverageHelper
AverageHelper

Reputation: 2221

How do I embed projects using Xcode 10?

I've been searching the internet for hours trying to figure this out. In previous versions of Xcode, I could drag a .xcodeproj file onto my workspace, and the groups, etc. of that project would be in the main one. That is, its sources and products would be accessible in the parent project. I mean to do this for a new private framework of mine, but it seems that in Xcode 10.2.1, this behavior is changed.

When I follow the instructions found in Apple's archived documentation (all that seems to survive), the .xcodeproj file sits alone in my file inspector. No reference hierarchy, and nothing happens when I click on it. On top of that, that project's frameworks are not accessible to the parent project.

Has anyone here figured out how this changed in Xcode 10, and what we are to do about it now? Many thanks!

Upvotes: 1

Views: 699

Answers (1)

user1118321
user1118321

Reputation: 26375

This certainly feels like a workaround, but it does seem to work:

  1. Open one of the projects you want to be in the final workspace
  2. From the "File" menu choose "Save As Workspace…" and save it somewhere on disk

This will create a new workspace that looks identical to the Xcode project you originally opened.

  1. From the "File" menu choose "Add files to “WorkspaceName“…" and select the next project you want in the workspace

At this point it will probably put the newly added project "inside" of the existing one in the file navigator pane. Simply drag it out to the top level and it will be on the same level as the original project. You should be able to twirl open the disclosure triangle and see the source files it contains. Clicking on the project will show the targets it contains.

  1. Repeat as necessary for the remaining Xcode projects

As you add projects, the schemes from each project will show up in the popup menu under the scheme button in the toolbar.

Upvotes: 1

Related Questions