Creating Xcode project from command line

前端 未结 2 1978
长发绾君心
长发绾君心 2021-01-04 00:55

My question is how can I create and Xcode project from the command line. By create I don\'t mean building a project. I mean how can i create a project forlder i.e shift + cm

相关标签:
2条回答
  • 2021-01-04 01:39

    Cmake will create Xcode projects along with any other type of build file you could desire. It is heavily customizable and can handle multiple targets, dependencies, linking, and any other property you could image. It has a steep learning curve but is a very very powerful tool. We currently use cmake to genererate both the Xcode and visual studio solution from the same code base.

    The simplest example of cmake is $cmake -G "Xcode" ...args... this would create and all all the nessecary files to your project from your args.

    Here is the main page: http://www.cmake.org

    0 讨论(0)
  • 2021-01-04 01:45

    An Xcode project consists of the source files for the project and and .xcodeproj folder (it looks like a file, but it's actually a bundle, i.e. a folder and files within it treated by Finder as a single object).

    If you look inside the .xcodeproj folder (you can do this with the terminal app or you can right-click on the .xcodeproj bundle and select "Show Package Contents") you will see several files. The only file that matter is project.pbxproj. The format of this file is undocumented, but it is a text file and if you take a look at it, the format doesn't seem too complicated.

    To generate a project you need to create a folder with an appropriate .xcodeproj folder within it and an appropriate project.pbxproj file inside that folder. If your project needs are simple, you could always start with a canned project.pbxproj file generated by Xcode and stick it in your .xcodeproj folder.

    0 讨论(0)
提交回复
热议问题