-
Notifications
You must be signed in to change notification settings - Fork 496
Building your Kitura application on XCode
Daniel Firsht edited this page Jun 22, 2016
·
24 revisions
Currently, you can build Kitura-based applications in XCode. This gives you features such as debugging, autocompletion, and syntax checking. The Swift package manager has the ability to generate XCode projects by reading your Package.swift file. It will automatically set up several targets that will be built using XCode- note that when XCode builds the project it is not using swift build
rather using its normal build process.
- Install the supported snapshot of the Swift toolchain
- Go to your project directory where you have your Package.swift file
- Run
swift package generate-xcodeproj
- Open the generated project in XCode. Its name matches the name in the Package.swift file.
- Change the build scheme to your runnable executable (mine is TodoList). By default it is the module of the same name which won't run.
- Run :)
Seeing error ld: library not found for -lCHttpParser for architecture x86_64
on build:
To solve this, go to your build settings and add $SRCROOT/.build/debug
to the Library Search Paths
for the KituraNet
and Kitura
targets.
- Follow the above instructions for creating an XCode project for your Kitura-based backend application. ./TodoList-server.xcodeproj
- Create a new iOS project and sources in a new subdirectory ex.
client/TodoList-ios.xcodeproj
- Create a new Xcode workspace in the root of your directory
./TodoList.xcworkspace
- Open up finder and drag and drop your TodoList-server.xcodeproj and TodoList-ios.xcodeproj to your workspace.
- Be sure to choose to create new references to these projects and sources, but do not actually copy the files in the filesystem.
- Select the scheme you wish to build the server and the client respectively.