Open a simple directory in XCode

I wanna browse through the source code of a project written in C++, and I feel like XCode is a more appropriate browser for C++ code than something like VSC. The folder has nothing xcode-like in it besides .cpp & .h files and nothing else.

XCode doesn't seem to like simple folders, I drag n' dropped one on the app and it thought the folder was a file, using cmd + O didn't help either. Is there some hidden method for opening directorys or is a 33 GB app not designed to open a simple folder? I've checked Google and shockingly didn't get an answer or anyone else experiencing the same problem, SO, Reddit, you name it.

Have faced the same issue ... this is insane to see a huge memory blocking IDE is not allowing to open a folder just because it's not something created from it ... wow.... nice ... that's not fair.

Same issue here. Unable to open a simple folder containing H and C files along with some assembly. This is very unfortunate.

If you want to just view the code, open them from the terminal: open *.* or open *.h for header files, open *.c for C files, etc. Assuming Xcode is the default app for opening these files in your system.

Alternatively, create an empty C/C++ project and then add the files to it.

If the code files include a cmake (https://cmake.org) project file CMakeLists.txt, then you can easily create an Xcode project from it:

mkdir xcode && cd xcode
cmake -GXcode ..

And then open the generated Xcode project file.

I'm also confused about this. How can I use XCode to browse a directory tree full of source files (in whatever languages) like any other IDE?

xed . or xed folderName

Open a simple directory in XCode
 
 
Q