Configure a plug-in for iOS with the Inspector window
Understand how to configure and add your native plug-in to your Xcode project using Inspector tools.
Read time 2 minutesLast updated 3 days ago
Use the Inspector window to add native plug-ins and their files to the generated Xcode project.
Select a plug-in in the Project window to open its settings in the window. If the compatibility settings match your build target, Unity includes the plug-in in the generated Xcode project. For general plug-in configuration, refer to Import and configure plug-ins.
Inspector
?
Unity supports native plug-ins for the following file types:
- Source files: ,
.m,.mm,.c,.cpp, and.h..swift - Binary files: ,
.bundle,.framework,.xcframework, and.a..dylib
When you place files with these extensions in the folder, Unity automatically enables them for the iOS platform.
Assets/Plugins/iOSDuring the build process, Unity copies these files into the generated Xcode project. Xcode then compiles or links to them in the final application. To configure compatibility for a specific plug-in, select it in the Project window to open its settings in the Inspector window.
iOS settings
Use the following Inspector window settings to configure a native plug-in for iOS.
Framework dependencies
Specify the operating system frameworks that your native plug-in depends on. Unity adds these to the Link Binary With Libraries section of the UnityFramework target in the Xcode project.
CPU
Specify the CPU architecture that your plug-in supports. It's recommended to support multiple architectures for broad compatibility. Unity provides ARM64 and x64 (Simulator) for testing.
Add to embedded binaries
Enable Add to Embedded Binaries to copy the plug-in into the final application package. This is required for:
- Dynamically loaded libraries ().
.dylib - Bundles and frameworks that contain dynamically loaded code.
- Assets and resources that must be loaded at runtime.
Compile flags
Set compiler flags for Xcode to use when building the plug-in source. These appear in the Xcode project under UnityFramework > Build Phases > Compile Sources > your plug-in > Compiler Flags.
Xcode project type
Choose which Xcode project type the plug-in applies to. You can set the project type in iOS Player settings: Objective-C or Swift.