You can download the ObjectBox framework from our Github releases page or get it via CocoaPods. Setup involves running a single script.
Add the following to your Podfile:
And then run
pod repo updatepod installPods/ObjectBox/setup.rb
The first call will ensure your local copy of the list of available CocoaPods is current, the second call is your usual procedure when adding a new pod to your file that will download the newest release of ObjectBox to your
Pods directory and install the Pod in your workspace.
Once you have ObjectBox downloaded,
setup.rb will set up the ObjectBox preprocessor in your project for every target with an executable.
You can now open your project's workspace as usual and follow the rest of this tutorial.
To download the pre-built framework for your project, fetch the version you need from our GitHub releases page:
and drop the extracted files somewhere in your project folder (for example, if your project is at
/path/to/MyProject.xcodeproj, you could put ObjectBox at
Once you have ObjectBox, you do like for any framework and drag the framework from
/path/to/ObjectBox/Carthage/Build/Mac/ObjectBox.framework for a Mac app) into the Linked Frameworks and Libraries list in the General tab of your target's settings in Xcode, and add a Copy Files build phase with Destination set to "Frameworks" into whose file list you also drag the framework.
Then open Terminal and run
gem install xcodeproj
/path/to/ObjectBox/setup.rb /path/to/MyProject.xcodeproj TargetName
TargetName is the name of whatever target in your project you want to use ObjectBox in. (If you leave away the target name, ObjectBox will pick all targets in your project that can be run, so applications)
The first call installs a helper library needed by the installation script to do its work. This library is not needed once you have run the script. Nobody else using your project needs to do this.
You can now open your project and follow the rest of this tutorial.
Currently, use of ObjectBox from a sandboxed macOS application requires you to set up at least one App Group for ObjectBox to be able to open a database, in addition to whatever you would normally have done to gain access to the destination folder under the sandbox:
Open your project in Xcode.
Select the project icon at the very to of the Project Navigator.
Select the Capabilities tab where you turned on App Sandbox.
Turn on the switch next to App Groups.
if the App Groups list is empty, Click the little "+" icon to add one.
You should now see a list entry like
FGDTDLOBXDJ.$(TeamIdentifierPrefix). If you only see
$(TeamIdentifierPrefix) , you still need to set up your team and code-signing under General.
That is all, ObjectBox will pick up the App Group Identifier without any additional work.