Create new xcode project from command line - xcode

I want to create iPhone application with native apple frameworks. But I want to create it from command line. Please help. Thanks

pod lib create ProjectName
This will create XCode project library, sample and UnitTests.

there is no ready-made tool to do this but you can use another project as a template, copy it, rename it and its targets/settings (it's all XML so you can parse and modify it, but for simplicity I would try to use a project template in which you only have to exchange some names :))

Related

Golang web app automatically build and run

I'm currently developing a simple web application.
But I find it tedious to rebuild my app whenever I update my source files.
Is there any way to automatically build and run my web app whenever i update my source files?
There is a very handy tool called pilu/fresh you might wanna check it out. We are personally using it on our project to automatically rebuild our code.
It's a very nice tool because it allows you to customize the file types to watch, and ignore files inside specified directories.
Hope this is what you're looking for.

Using Command line to add files to xcode project

I am trying to write a bash script that downloads a bunch of classes from the internet, inserts them into an existing (or maybe not?) xcode project and compiles them using xcodebuild into a static library.
However, I could not find a way to add classes to the project via command line, but only by gui.
Is there any way to do so?
In addition, is there any way to create an xcode project via the command line?
You should read about cocoapods.
Regarding your second question about creating a project via the command line, check this link: cmake
If I remember correctly the terminal command should be something like cmake -G Xcode .....
An old problem and I haven't found a valid solution, but actually, with a bit knowledge from the community, it wasn't that hard to solve. I published my results in the github project XCodeControl.
You need a basic xcode project created by xcode though. It should be possible to create an empty xcode project pattern and copy+modify that to create a new project.

Create "Template" XCode project that automaticly adds git-submodules etc?

I have a few xcode projects (static libraries) that I include in several other projects through the use of git-submodules. This works great and I like this way of sharing code between projects. However, since I am adding some of these libraries to pretty much every new project I create I would like to streamline this process somehow. Create some sort of "template" of which I can base all my projects.
I would like some way to automaticly go through these steps:
Create a new project called X
Add a fixed (or dynamic) list of submodules
Have the added submodules automaticly added to the Xcode-project
Is it possible to create a script for this? With a syntax like:
fooproj -n "Bar" -s "foundation, coredata, uikit"
(where Bar is the name of the new project and foundation, coredata and uikit would be the submodules to add)
Or is there some other way I could streamline this process?
Have you looked into Xcode Templates? They're quite powerful and are the basis of how Xcode currently sets up new projects. Here are a few links on how to create Xcode templates:
NSScreencast, bob Mccune's blog, meandmark.com
And a few sample resources to get you started:
Xcode 5 project templates and Minimal templates
They're confusing at first, now I couldn't live without them. Xcode templates are a huge time-saver.

Creating a Cocoa Framework

I've created a working Cocoa framework which I wish to redistribute. The problem is however, it won't run outside of Xcode. I've read something about #executable_path/../Frameworks, which I did not include, because I don't know where to put it :/
Therefore I run my app in Xcode using the DYLD_FRAMEWORK_PATH variable which works fine, but only in Xcode - if I try to run it on its own it crashes straight away and says IMAGE NOT FOUND.
I'm sure #executable_path/../Frameworks is what's missing, but I don't know where to put it.
Could anyone help me out please? :)
Thanks
Here is how I usually manage things:
In the framework's Xcode project, set the Installation Directory to #rpath
Add the framework to your application's Xcode project. Add a Copy Files build phase, select Frameworks in the Destination popup, and ensure your framework is added so it will be copied to your application's Frameworks directory when it is built.
Finally, in your project's settings, add #loader_path/../Frameworks to Runpath Search Paths.
Are you actually copying the framework into your applications bundle? Look for the folder called MacOS which is what contains the binary. There should be another folder at the same level called Frameworks and it should have the framework inside it.
If it's not there you need to create a copy files build phase for the application that copies the framework into the Frameworks folder.

How to create a new XCode project from an existing c/c++ code space

How to create a new XCode project from an existing c/c++ code space?
What type of project I should pick from XCode project template?
Thank you.
Assuming the existing code has a build system like Make or CMake etc., you probably want to use the "External Build System" template under "Other" in the projects pane. If you want to incorporate the existing code into a new application/framework/etc., create a template for the type of product you want to eventually build, then add a "Run Script" build phase to call your external build system.
MacResearch.org has a tutorial on using the Xcode Organizer to build external targets that you may also find useful.

Resources