Enable ARCore in your iOS projects.
Prerequisites
ARCore requires a deployment target of 12.0 or higher.
Install the ARCore SDK for iOS
You must build your app with iOS SDK version 15.0 or higher. The SDK can be installed using either CocoaPods or the Swift Package Manager (currently in beta).
Use CocoaPods
Specify the ARCore SDK for iOS in your Podfile
to integrate it into your Xcode project:
target 'YOUR_APPLICATION_TARGET_NAME_HERE'
platform :ios, '12.0'
pod 'ARCore/SUBSPEC_NAME_HERE' ~> VERSION_HERE
Valid ARCore subspecs are Geospatial
for the Geospatial API,
CloudAnchors
for the Cloud Anchor API, and AugmentedFaces
for Augmented Faces.
Run the following command to install it:
pod install
Use Swift Package Manager
Starting with the 1.36.0 release, ARCore officially supports installation via Swift Package Manager:
- Go to File > Add Packages and enter the package URL:
https://github.com/google-ar/arcore-ios-sdk
- Set the Dependency Rule to be Up to Next Minor Version and select the latest release of ARCore.
- Select the desired ARCore libraries to include. Libraries can also be added later via Build Phases > Link Binary With Libraries.
- Add the flag
-ObjC
to Other Linker Flags. It is recommended to set Other Linker Flags to$(inherited) -ObjC
. - Make sure that the Enable Modules and Link Frameworks Automatically build settings are set to Yes, because ARCore relies on auto-linking.
- Make sure that Enable Bitcode is set to No, because ARCore binaries do not contain bitcode.
Create a Google Cloud project and enable the ARCore API
Before you can start using the ARCore Cloud Anchor API or the ARCore Geospatial API, you must first set up the ARCore API in a new or existing Google Cloud project.
Comply with the User Privacy Requirements
Make sure that your app complies with ARCore's User Privacy Requirements.
Next steps
- Learn how to configure an ARCore session in iOS.
- Check out the iOS reference documentation.