Version: 2018.1
iOS account setup
Structure of a Unity XCode Project

Внутри процесса сборки под iOS

Editor Based Building and Running

The iPhone/iPad application build process is a two step process:

  1. Генерируется проект XCode со всеми необходимыми библиотеками, заранее скомпилированным .NET кодом и сериализованными ассетами.
  2. Собирается проект XCode и разворачивается на реальном устройстве.

When “Build” is hit on “Build settings” dialog only the first step is accomplished. Hitting “Build and Run” performs both steps. If in the project save dialog the user selects an already existing folder an alert is displayed. Currently there are two XCode project generation modes to select:

  • replace - все файлы из целевой папки удаляются и там генерируется новое содержимое.
  • append - “Data”, “Libraries” и корневая папка проекта очищаются и заполняются свежесгенерированным содержимым. Файл проекта XCode обновляется в соответствии с последними изменениями проекта Unity. Подпапка “Classes” проекта Xcode может быть рассмотрена как безопасное место, для хранения пользовательского нативного кода, но всё же рекомендуется регулярно создавать резервные копии. Режим Append поддерживается только уже существующими проектами XCode, созданными при помощи такой же версии Unity iOS.

Если нажать Cmd+B, то будет вызван автоматический процесс Build and Run и последняя использованная папка будет рассмотрена как целевая для сборки. В этом случае, по умолчанию стоит режим append.

Note: Step one above can be performed on a PC or a Mac. Only a Mac can perform Step two. This means to get a Unity project running on an iDevice you will need to have a Mac.

Command Line Building

Once Unity has been used to build the XCode project it is possible to perform the build and run from the command line. After the editor has built the XCode project do the following from the terminal:

unity$ xcodebuild test -destination "platform=iOS,id=400d20d00baf8d4997b47be0416cf5c44dd2d3bc" -scheme Unity-iPhone

Note that 400d20d00baf8d4997b47be0416cf5c44dd2d3bc in the command line example above is the ID of the iDevice that will run the project. You will need to determine your device ID using the Window > Devices menu in XCode.

iOS account setup
Structure of a Unity XCode Project