In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?

First choose file > new > Workspace...

Then, you must first, and this is important, you must first close the project that you want to drag in. Than drag in the .xcodeproj file from the finder to your new workspace. Then it will appear properly and expand to show all of its files and your schemes will be available.


Although the accepted answer is correct, there is an alternate way to accomplish the same thing, and it is arguably easier/more straightforward. You can just open up the project in Xcode and click File -> Save as Workspace...

Bam! You now have a workspace with 1 project in it, as requested.


Just FYI, 2020, Apple recently added a thing,

  1. make your workspace, exit it and

  2. make your new project. in fact when you enter the name to save the project,

they added this option:

enter image description here

just select the workspace you wish to add it to.

Tags:

Xcode