Skip to content

arunityX on iOS

Philip Lamb edited this page Jun 5, 2023 · 4 revisions

System requirements

artoolkitX for Unity for iOS supports the same platforms as artoolkitX for iOS, which includes all versions of iOS from 11.0 onwards, on both iPhone and iPad devices.

While you may be able to export an iOS project from Unity on Windows, as deployment from Unity on iOS involves a required additional step of building the exported Xcode project, generally a Mac running Xcode 14 or later is required. If building the package from source, a Mac is required to build and/or fetch the iOS native plugin.

An Apple Developer Account is required to build for iOS devices. Running artoolkitX in the simulator is not supported.

Video input.

It uses the same AVFoundation-based video capture module as artoolkitX for mac OS. The SDK supports auto-configuration of the video feed, using the ARVideoConfig component:

ARVideoConfig settings for iOS

Input selection

Select input by: Explanation
Any camera Selects the first available camera on the device, usually the back camera.
Nth camera Where the device has more than one camera, this options allow selection of the "n"th camera, e.g. set to 2 to select the second camera on the device, irrespective of position.
Camera at position Selects the first available camera at the specified position on the device (back, i.e. facing away from the user, or front, i.e. facing towards the user)
Nth camera at position Where more than one camera is available at the specified position, allow selection of the camera by index, e.g. the second back-facing camera.
Video source info list Does a live query of the available video options while running in the Unity Editor. Not useful for iOS

Size preset

Different sizes for the incoming video stream are supported. Both fixed sizes, and device-dependent presets are available. Note that selecting high-resolution sizes may have a severe impact on tracking performance, and "medium" has been found to be a good fit for most iOS devices.

Manually override.

You can manually override the Unity Editor-specified config by checking this box, and then using config options as per the table at https://github.com/artoolkitx/artoolkitx/wiki/artoolkitX-video-module-configuration-reference#ar_video_module_avfoundation

iOS deployment

artoolkitX for Unity includes a post-processor Unity Editor script which:

  1. Adds libsqlite3 as a required link library.
  2. Disables bitcode generation (still enabled in Unity as of Unity 2021.3, but now deprecated in Xcode 14).
  3. Checks that the "camera usage description" field in the Unity "Project Settings" is set to a reasonable default.

Be sure to set the name of your iOS development team in Unity, or you will be prompted for it when attempting to build the Xcode project.

Common problems and solutions

Problem Cause Solution or workaround