Structure of a Unity Xcode Swift project type
Organization and layout of Unity Swift Xcode projects.
読み終わるまでの所要時間 6 分最終更新 5日前
When you build a Unity Xcode Swift project for the iOS platform, Unity creates a folder that contains an Xcode project. You need to build and sign this project before you deploy it on a device or distribute it on the App Store.
Every generated Unity iOS Xcode Swift project has the following structure and targets:

Unity iOS Xcode Swift project structure
The Xcode project includes both the project file and framework links that only appear in the Xcode project navigator. Apart from the default folders, you can create custom folders to add custom files as required.
.xcodeprojFor projects that use Swift, Unity generates the file name from your Unity project name. It sanitizes the name by removing spaces, symbols, and other non-alphanumeric characters.
.xcodeprojYou can use to return the file path rather than using a hardcoded file name.
PBXProject.GetPBXProjectPathxcodeprojProject targets
A Unity Xcode Swift project contains the following targets:
Target | Description |
|---|---|
| Unity-iPhone | A thin launcher part that runs the Note: |
| UnityFramework | The target that produces the |
| UnityAPI | A static framework that produces the Note: This target is generated only for the Swift project type. The Objective-C project type doesn't contain it. |
| GameAssembly | A container for your C# code translated as C++ code. To build it, Xcode uses the IL2CPP tool that Unity includes in every generated Xcode project. The build produces:
|
Project structure
When developing a Swift project type, Unity guarantees that certain parts of the generated Xcode project will remain the same during development. The following files and folders will be treated as a public API and will follow a standard deprecation process when any changes are made. For more information, refer to Swift project type API reference.
Project file structure
- {projectName}.xcodeproj: The main Xcode project file in the root directory.
- Data/: The folder that contains compiled Unity Engine content.
- UnityFramework/Libraries/: The standard folder for library files added by plug-ins.
- UnityFramework/Info.plist: The property list for the UnityFramework.
- UnityFramework/PrivacyInfo.xcprivacy: The privacy manifest file required by Apple.
- UnityAPI/UnityPluginInterface/: Contains headers available for plug-ins to import.
Data folder
This folder contains your application’s serialized assets and .NET files. The file sets up various .NET services such as Security and WebRequest. By default, the Data folder’s Target Membership is the Unity-iPhone target, and Unity runtime searches for it in the mainBundle.
.datmachine.config
Data folder with the Target Membership set to Unity-iPhone
Frameworks folder
The Frameworks folder contains , the Unity Runtime static frameworks library for device and simulator.
UnityRuntime.frameworkLibraries folder
The contents of the Libraries folder are refreshed with every build. You shouldn’t make any changes to it.
MainApp folder
The folder contains the application’s , icons and splash screens (.png files) in asset catalogs, launch screens, their XML Interface Builders (.xib files), and Storyboard files. Unity automatically manages these files. You can configure icons and launch screens in the Player settings window (menu: Edit > > Player). Make sure the custom launch images that you create adhere to Apple’s Human Interface Guidelines.
MainAppInfo.plistProject Settings
?
Property list (.plist) file
The file for the Unity-iPhone target is located at (accessed via ). You can manage it from Unity’s Player settings window (menu: Edit > Project Settings > Player > Other Settings > Identification). Unity updates this file rather than replacing it while building the Player. Don’t make changes to it unless you need to.
Info.plistMainApp/Info.plistmainBundleThe file, accessed via , is a part of . You can keep project specific values in this file instead of the file of the . This makes sure that you can still get these values if is moved into another application, for example, when using Unity as a Library.
/UnityFramework/Info.plistbundleWithIdentifier:@"com.unity3d.framework"UnityFrameworkInfo.plistmainBundleUnityFramework