Augmented Faces quickstart for iOS

  • This guide explains how to set up your development environment for Augmented Faces, apply 2D textures, and attach 3D objects to detected faces in iOS apps.

  • It requires Xcode 13.0+, Cocoapods 1.4.0+ (if using), and an ARKit-compatible device running iOS 12.0+ for development.

  • The provided sample app demonstrates these capabilities and can be used as a starting point for your own AR experiences.

  • To get started, clone the ARCore SDK, run pod install, and build/run the sample app on a physical device.

  • Further documentation and resources are available for in-depth learning and development.

This guide shows you how to:

  • Set up your development environment to work with Augmented Faces
  • Apply 2D textures and attach 3D objects to detected faces

Prerequisites

  • Xcode version 13.0 or later
  • Cocoapods 1.4.0 or later if using Cocoapods
  • An ARKit-compatible Apple device running iOS 12.0 or later (deployment target of iOS 12.0 or later required)

Using Augmented Faces

The following steps use the Augmented Faces sample app to show you the critical tasks for configuring and building an app with Augmented Faces capabilities.

Get the Augmented Faces sample app

  1. Clone or download the latest ARCore SDK for iOS from GitHub to obtain the sample app code.
  2. Open a Terminal or Finder window and navigate to the folder where you cloned or downloaded the SDK.
  3. You can find the sample app code in /Examples/AugmentedFacesExample.

Run pod install

The AugmentedFacesSample app ships with a Podfile preconfigured with the ARCore SDK and iOS versions that you'll need. To install these dependencies:

  1. Open a Terminal window and run pod install from the folder where the Xcode project exists. This generates an *.xcworkspace file that you'll use later to build and run the app.

Build and run the app

  1. Open the .xcworkspace (not the .xcodeproj) file for the project in Xcode.
  2. Open the target’s general settings and change the bundle identifier.
  3. Hit Cmd+R or click Run. Use a physical device, not the simulator, to work with Augmented Faces. The device should be connected to your development machine via USB.

Try out the sample app

  1. Build and run the sample app from the .xcworkspace file to launch it on your device.
  2. If prompted, grant camera permissions to the app. ARCore then starts detecting faces visible in the camera. Currently, only once face is detected at a time.
  3. Make sure that the camera is facing the user.

Next steps