Сборка unity под ios на windows

Using the Unity Developer Dashboard to configure Unity Cloud Build for Plastic

Using the Unity Developer Dashboard to configure Unity Cloud Build for Plastic

Set up a Gymfile in Unity Cloud Build

Cloud Build helps you automate the process of building your Unity Project for iOS devices.

This article describes the prerequisites necessary to build your Project for iOS and create the supporting components to configure Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary
. Topics covered include:

  • Joining the Apple Developer Program
  • Creating an iOS certificate and p12 file
  • Adding devices to your profile
  • Creating a provisioning profile
  • Configuring your app to build for iOS

Joining the Apple Developer Program

To develop iOS apps, you must be a member of the Apple Developer Program. This lets you build, test, and eventually release your apps in the Apple App Store.

Note: You must have an Intel-based Mac running OS X Yosemite (v10.10) or later to develop and distribute iOS apps and Mac apps.

After you sign in to the Apple Developer program portal, you’ll see a list labeled Program Resources on the left. Click Certificates, IDs & Profiles to manage the certificates, identifiers, profiles, and devices you need to develop and distribute apps.

Provisioning profiles

A provisioning profile ties developers and devices to an authorized Development Team and enables you to use a device for testing. You must install a Development Provisioning Profile on each device you plan to run your application code.

Each Development Provisioning Profile contains a set of Development Certificates, Unique Device Identifiers (UDID), and an App ID.

To use a device for testing, you must also include your Development Certificate in the profile. A single device can contain multiple provisioning profiles.

Components of a provisioning profile

Certificates determine whether your app is development-only or a release candidate for the App Store. You should use an Ad Hoc Production Certificate so that you can test all the features of your game (such as GameCenter).

Identifiers are the unique IDs that identify your project. For basic projects, or if this is your first iOS project, you should make an App ID. This is often the same as your Unity3D Project’s Bundle ID.

Tip: For more information on signing identities and certificates, see Maintaining Your Signing Identities and Certificates on the Apple developer website.

Devices are the hardware—such as an iPhone, iPad, or iPod—on which you plan to test your project. You must retrieve the UDID for each device on which you plan to test your game. You then add the UDID to the Devices section in the iOS developer portal.

Note: Each year, you can register a fixed number of devices. The maximum number of devices you can register is 100 devices per product family per membership year. For more information see, Registering Devices Using Your Developer Account in the Maintaining Identifiers, Devices, and Profiles topic on the Apple developer website.

Creating an iOS certificate and p12 file

When you create a certificate, you must decide whether to create a Development Certificate (used only for testing), or a Production Certificate, which you use to distribute your app via the App Store.

Tip: Create a Production Certificate. While either certificate type works for development, Production Certificates make it easier to release your app to the App Store.

Create a certificate

  1. Sign in to your Apple Developer Program.
  2. Click Member Center > Certificates > Identifiers & Profiles > Certificates.
  3. In the left-hand column, under Certificates, click All.
  4. In the screen labeled What type of certificate do you need, choose the type of certificate to generate. Typically, if you’re starting, you should to pick an App Store and Ad Hoc production certificate.
  5. Use the Keychain Access program on your Mac (open your Finder and find it in Applications/Utilities) to generate a Certificate Signing Request (CSR) file. Follow the instructions in the iOS portal to complete this step. Make a note of where you save the CSR file.
  6. In the Generate your certificate screen, upload your CSR file (which might have the extension .certSigningRequest). Click the Choose File button and select your CSR file, and then click the Generate button.
  7. To download your certificate to your Mac, click the Download button on the Your Certificate is Ready screen. Store this file somewhere safe and back it up.

To add the certificate to a keychain, locate the certificate file and double-click it. This opens the Keychain Access program. If you get a popup with the message “Do you want to add the certificate to a keychain?”, choose login and click the Add button.

Export a p12 file

To create apps using Unity Cloud Build, you must convert your certificate file to a p12 file. A p12 file is a file that contains your private key and certificate and is used to sign your code. Typically, if you develop a project in native Xcode, this process is handled behind the scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

To generate a p12 file:

  1. On your Mac, open up your Finder and in Applications/Utilities, open the Keychain Access program.

  2. In the left-hand column, under keychains, verify that Login is selected.

  3. In the left-hand column, under Category, verify that My Certificates is selected. In the main Keychain Access pane, select your certificate.

    Note: Typically, your certificate is located under My Certificates. If it is not there, check under Certificates.

  4. From the File menu, select File > Export Items, or right-click and select Export.

  5. Select Personal Information Exchange (.p12) from the File Format drop-down menu.

    Note: If Login under Keychains and My Certificates under Category is not selected, the p12 option is greyed out.

  6. Ceate a password for the p12 file.

    Note: Record the password somewhere safe as you must supply it when setting up iOS builds on Unity Cloud Build.

Adding devices

For development purposes, Apple requires the UDID for each device on which you intend to install your app. Once your app is accepted into the App Store, anyone can download and install it; provided they have the correct version of iOS and meet any other requirements.

Finding your UDIDs

You can use iTunes to retrieve the UDID of your device. For a walkthrough of the retrieval process, see WhatsMyUDID.com.

The basic steps are:

  1. Open iTunes on your Mac.
  2. Connect the device (iPhone, iPad, etc) to the computer.
  3. In iTunes, select the device.
  4. You should see a screen with the device name, capacity, and other details about the device. To display the UDID, click the Serial # field.
  5. Copy and paste the UDID into a document where you can retrieve it later.
  6. Close iTunes and disconnect your device.

Add the UDID in the Apple developer portal

To add your device UDID(s) to the Apple Developer Portal:

  1. Click the All section under Devices in the left column of the Apple Developer Portal.
  2. To add a new UDID, click the Add button (+) in the upper-right corner
  3. Give the device a name you will recognize, and copy-paste the UDID you got from iTunes into the UDID field.
  4. Click Continue.

Repeat the steps for each of your devices.

Create App ID

Now that you’ve created your iOS Certificate, you can create an App ID:

  1. In the left-hand column of the Apple Developer Portal, click App ID.

  2. In the Register iOS App IDs pane, at the top right, click the Add button (+).

  3. In the Registering an App ID pane, enter the following information:
    1. App ID Description: The name of your app, without any special characters.
    2. App ID Suffix: If you intend to incorporate specific services such as Game Center or In-App Purchases, create an Explicit ID. If you don’t need these services, then create a Wildcard App ID. A Wildcard App ID lets you re-use the App ID for multiple projects.
    3. App Services: Optional. Indicate whether you plan to use any of the Apple App Services.

    For more information on registering an App ID, see Maintaining Identifiers, Devices, and Profiles.

  4. Click the Continue button.

  5. On the Confirm your App ID page, check the information you’ve provided and then click the Submit button.

Create a provisioning profile

The next step is to generate a .mobileprovision file. The .mobileprovision file combines your p12 certificate, App ID, and identifies the UDIDs of the devices on which you are testing your app.

  1. In the Apple Developer portal, click Certificates, IDs & Profiles.
  2. In the left-hand column of the Apple Developer Portal, under Provisioning Profiles, select All.
  3. To add a new Provisioning Profile, click the Add button (+) in the upper-right corner.
  4. Under Development, select the type of provisioning profile to create and click Continue.
    Note: If you’re just getting started, you should use a Distribution > Ad Hoc certificate, as this lets you build your game and test it on devices.
  5. Select the App ID to use for development, and click the Continue button.
  6. Select one or more development certificates, and click the Continue button.
  7. Select one or more devices, and click the Continue button.
  8. Enter a profile name, and click the Generate button.
  9. Click Done.

Download the generated .mobileprovision file to your desktop machine.

Configuring your app to build for iOS

To configure your iOS Cloud Build, you need the following items:

  • Your provisioning profile (.mobileprovision)
  • Your .p12 file
  • The password for your .p12 file

For basic iOS usage this process should be sufficient. For projects that include Xcode frameworks, you must perform some additional configuration.

Using Xcode Frameworks

To add Xcode frameworks manually, use the Xcode Manipulation API. The API lets you manage external Xcode frameworks.

For an example of a Unity Project that uses the API, see the UpdateXcodeProject example Project on BitBucket. You can use the example to experiment and to learn from.

One of the plugins of the example Project is an external Xcode project manipulation DLL. The DLL is the build product of the source available in Unity’s Bitbucket repository. A preferred way to include Xcode project manipulation functionality is to copy the C# source code files to the Assets/Editor folder in your Project.

You can use the Xcode Manipulation API in the following ways:

  • Use the built-in Unity PostProcessBuildAttribute, which is executed before the Unity Cloud Build Post-Export method runs.
  • Use the Unity Cloud Build Post-Export method (requires access to advanced settings).

Using the Unity Developer Dashboard to configure Unity Cloud Build for Plastic

Set up a Gymfile in Unity Cloud Build

Проекты под iOS несколько отличаются от проектов для других платформ. В этой статье мы по пунктам разберем действия, требующиеся для успешной сборки приложения для iOS и рассмотрим некоторые аспекты оптимизации приложений под мобильные платформы.

Прежде чем запускать Unity iOS приложение на реальном устройстве, а без него и не получится скомпилировать проект, требуется создать собственный подтвержденный и настроенный аккаунта разработчика Apple (Apple Developer), а также выполнить несколько шагов для того, что-бы можно было собрать и запустить ваш проект на каком либо из устройств.

Первое, что надо сделать – это подать заявку Apple, чтобы стать зарегистрированным разработчиком. Для этого надо перейти на сайт Apple: https://developer.apple.com/programs/

Второе:  требуется обновить операционную систему и копию iTunes. Следует отметить, что это требования Apple , как часть использования iPhone SDK. И эти требования со временем могут измениться.

Третье: надо скачать и установить последнюю версию iOS SDK из  iOS dev center и установить ее.

Вместе с iOS SDK будет установлен XCode.

Четвертое: вам потребуется получить идентификатор устройства. Для этого присоедините ваше iOS устройство к Mac через USB кабель и запустите XCode. XCode обнаружит ваш телефон как новое устройство и вам надо будет его зарегистрировать нажав кнопку “Use For Development”. После этого обычно открывается окно Organizer, но если не откроется, то откройте его вручную через Window->Organizer. Вы должны будете увидеть своё устройство в списке устройств слева; выберите его и запишите идентификационный код UDID вашего устройства (длина которого около 40 символов).

Пятое: добавление устройства. Для этого нам потребуется зайти в центр разработчика iPhone (https://developer.apple.com/iphone/) и войти в программный портал (кнопка справа). На странице Devices, нажмите на ссылку слева, и затем нажмите на кнопку Add Device справа. Введите имя вашего устройства (только буквы и цифры) и идентификационный код вашего устройства (указан выше в шаге 4). Когда закончите, нажмите на кнопку Submit.

Шестое: создание сертификата. Для iPhone Developer Program Portal нажмите на Certificates link с левой стороны и нажмите плюсик для добавления нового сертификата.

Седьмое: скачивание и установка промежуточного сертификата WWDR. Ссылка на скачивание расположена в том же разделе “Certificates” (чуть выше рубрики “Important Notice”) подписанная WWDR Intermediate Certificate. По окончании скачивания, дважды кликните на нём, чтобы установить сертификат.

Восьмое и последнее в подготовке это создание Provisioning файла. Достаточно сложно подобрать общие инструкция для Provisioning, поэтому вам следует самим ознакомится  разделом Provisioning How-to (http://developer.apple.com/iphone/manage/provisioningprofiles/howto.action) на сайте разработчика Apple.

На этом настройку аккаунта разработчика можно считать оконченой и можно приступить к настройке Unity и сборке первого проекта.

Итак, нам требуется сменить платформу, по умолчанию в Unity стоит windows. Запускаем Unity и после загрузки открываем окно Build Settings. File>Build Settings и в пункте справа у вас появится список доступных платформ. Нам требуется выбрать iOS ,нажать кнопку Switch platform и Unity автоматически настроит ваш проект под новую платформу. Если же у вас не установлен модeль iOS то кнопка Switch platform окажется не активна, а в центре окна появится кнопка Open download page. При нажатии на нее начнется автоматическое скачивание нужного модуля.

Для первой сборки все готово. Теперь рассмотрим как собирается проект. У нас в окне Build Settings есть две кнопки: Bould и Build and Run.    При нажатии кнопки Build появляется окно, где вам будет предложено выбрать папку для вашего приложения.

После подтверждения выбора папки, генерируется проект XCode со всеми необходимыми библиотеками, заранее скомпилированным .NET кодом и сериализованными ассетами.  А при нажатии Build and Run выполняется шаг Build, а затем собирается проект XCode и разворачивается на подключенном устройстве. Следует заметить, что если в окне сохранения проекта,вы выберете уже существующую папку, то будет отображено предупреждение. На данный момент, на выбор есть 2 режима генерации проекта XCode:

replace – все файлы из целевой папки удаляются и там генерируется новое содержимое.

append – “Data”, “Libraries” и корневая папка проекта очищаются и заполняются новым содержимым. Файл проекта XCode обновляется в соответствии с последними изменениями проекта Unity.

Теперь подключаем наш  iPhone к Mac и жмем Build and Run. Ждем окончания сборки и запуска свежесобранного приложения на устройстве. Но ничего не происходит. Наверное потому, что наш проект пуст. Давайте добавим в него небольшой текст. Для этого нажмем GameObject>UI>Text. В проекте автоматически создастся Canvas в котором появится элемент UI Text.

Немного изменим его размеры и положение на экране. Слева в инспекторе pos x, pos y и pos z сделаем равными нулю. Теперь наш текст будет всегда в центре экрана. Далее установим размеры нашего текста. Пусть будет width  равно 400, а height равно 150.

Затем сам текст “Hello, world!

Нам потребуется немного отформатировать его,  чтобы текст было видно на экране. Для этого изменим значение Font Size до такого значения, пока наша надпись не станет отчетливо видна и не поместится в одну строку.

Отлично. Осталось добавить сцену с нашим текстом в Scenes in Build для того, чтобы она добавилась в наше приложение. Нажимаем File>Build Settings и в открывшемся окне Add Open Scenes.

Теперь осталось нажать кнопку Build and Run и дождаться что скажет нам наше приложение с экрана iPhone.

Cloud Build помогает автоматизировать процесс создания проекта Unity для iOSмобильной операционной системы Apple. Подробнее
См. на устройствах Словарь
.

В этой статье описываются предварительные условия, необходимые для создания проекта для iOS и создания вспомогательных компонентов для настройки Cloud Buildнепрерывной интеграции. сервис для проектов Unity, автоматизирующий процесс создания сборок на серверах Unity. Подробнее
См. в Словарь
. Рассматриваемые темы включают:

  • Присоединение к программе Apple для разработчиков
  • Создание сертификата iOS и файла p12
  • Добавление устройств в ваш профиль
  • Создание профиля обеспечения
  • Настройка приложения для iOS

Присоединение к программе Apple для разработчиков

Чтобы разрабатывать приложения для iOS, вы должны быть участником Программы разработчиков Apple. Это позволяет создавать, тестировать и, в конечном итоге, выпускать приложения в Apple App Store.

Примечание. Для разработки и распространения приложений для iOS и Mac у вас должен быть компьютер Mac с процессором Intel под управлением OS X Yosemite (v10.10) или более поздней версии.

После того как вы войдете на портал программы Apple Developer, слева вы увидите список с пометкой Ресурсы программы. Нажмите «Сертификаты, идентификаторы и профили», чтобы управлять сертификатами, идентификаторами, профилями и устройствами, необходимыми для разработки и распространения приложений.

Профили предоставления

Профиль подготовки связывает разработчиков и устройства с авторизованной группой разработчиков и позволяет использовать устройство для тестирования. Вы должны установить профиль обеспечения разработки на каждое устройство, на котором вы планируете запускать код приложения.

Каждый профиль обеспечения разработки содержит набор сертификатов разработки, уникальных идентификаторов устройств (UDID) и идентификатор приложения.

Чтобы использовать устройство для тестирования, вы также должны указать свой сертификат разработки в профиле. Одно устройство может содержать несколько профилей обеспечения.

Компоненты профиля обеспечения

Сертификаты определяют, предназначено ли ваше приложение только для разработки или оно является кандидатом на выпуск для App Store. Вам следует использовать специальный производственный сертификат, чтобы вы могли протестировать все функции вашей игры (например, GameCenter).

Идентификаторы — это уникальные идентификаторы, идентифицирующие ваш проект. Для базовых проектов или если это ваш первый проект для iOS, вам следует создать идентификатор приложения. Часто это совпадает с идентификатором пакета вашего проекта Unity3D.

Совет. Дополнительные сведения о подписании удостоверений и сертификатов см. в разделе Управление вашей подписью и сертификатами на веб-сайте разработчиков Apple.

Устройства – это оборудование, например iPhone, iPad или iPod, на котором вы планируете тестировать свой проект. Вы должны получить UDID для каждого устройства, на котором вы планируете тестировать игру. Затем вы добавляете UDID в раздел «Устройства» на портале разработчиков iOS.

Примечание. Каждый год вы можете регистрировать определенное количество устройств. Максимальное количество устройств, которое вы можете зарегистрировать, составляет 100 устройств на семейство продуктов за год членства. Дополнительную информацию см. в разделе Регистрация устройств с использованием вашей учетной записи разработчика в разделе Поддержка идентификаторов, устройств и профилей на веб-сайте разработчиков Apple.

Создание сертификата iOS и файла p12

При создании сертификата вы должны решить, создавать ли Сертификат разработки (используемый только для тестирования) или Сертификат рабочей версии, который вы используете для распространения приложение через App Store.

Совет. Создайте производственный сертификат. Хотя любой тип сертификата подходит для разработки, рабочие сертификаты упрощают выпуск вашего приложения в App Store.

Создать сертификат

  1. Войдите в свою Программу для разработчиков Apple.
  2. Нажмите Member Center > Сертификаты > Идентификаторы и профили > Сертификаты.
  3. В левом столбце в разделе Сертификаты нажмите Все.
  4. На экране с надписью Какой тип сертификата вам нужен выберите тип создаваемого сертификата. Как правило, если вы начинаете, вам следует выбрать сертификат для App Store и Ad Hoc.
  5. Используйте программу Keychain Access на своем Mac (откройте Finder и найдите ее в разделе Applications/Utilities), чтобы создать файл запроса на подпись сертификата (CSR). Следуйте инструкциям на портале iOS, чтобы выполнить этот шаг. Запишите, где вы сохранили файл CSR.
  6. На экране Создайте сертификат загрузите файл CSR (который может иметь расширение .certSigningRequest). Нажмите кнопку Выбрать файл и выберите файл CSR, а затем нажмите кнопку Создать.
  7. Чтобы загрузить сертификат на свой Mac, нажмите кнопку Загрузить на экране Ваш сертификат готов. Сохраните этот файл в безопасном месте и создайте его резервную копию.

Чтобы добавить сертификат в связку ключей, найдите файл сертификата и дважды щелкните его. Откроется программа Keychain Access. Если появится всплывающее окно с сообщением «Хотите добавить сертификат в связку ключей?», выберите «Войти» и нажмите кнопку Добавить.

Экспорт файла p12

Чтобы создавать приложения с помощью Unity Cloud Build, необходимо преобразовать файл сертификата в файл p12. Файл p12 — это файл, который содержит ваш закрытый ключ и сертификат и используется для подписи вашего кода. Как правило, если вы разрабатываете проект в родном Xcode, этот процесс обрабатывается за сценамиСцена содержит среды и меню вашего игра. Думайте о каждом уникальном файле сцены как об уникальном уровне. В каждой сцене вы размещаете свое окружение, препятствия и декорации, по сути проектируя и создавая свою игру по частям. Подробнее
См. в Словарь
.

Чтобы создать файл p12:

  1. На компьютере Mac откройте Finder и в разделе «Приложения/Утилиты» откройте программу «Связка ключей».

  2. Убедитесь, что в левом столбце в разделе «Связки ключей» выбрано значение Логин.

  3. Убедитесь, что в левом столбце в разделе Категория выбрано значение Мои сертификаты. На главной панели Доступ к связке ключей выберите свой сертификат.

    Примечание. Как правило, ваш сертификат находится в разделе Мои сертификаты. Если его нет, проверьте в разделе Сертификаты.

  4. В меню Файл выберите Файл > Экспортировать элементы или щелкните правой кнопкой мыши и выберите Экспорт

  5. Выберите «Обмен личной информацией» (.p12) в раскрывающемся меню «Формат файла».

    Примечание. Если параметр Войти в разделе Связки ключей и мои сертификаты в разделе Категория не выбран, параметр p12 неактивен.

  6. Создайте пароль для файла p12.

    Примечание. Запишите пароль в безопасное место, так как вы должны указать его при настройке сборок iOS в Unity Cloud Build.

Добавление устройств

В целях разработки Apple требует UDID для каждого устройства, на котором вы собираетесь установить приложение. Как только ваше приложение будет принято в App Store, его сможет скачать и установить любой желающий; при условии, что у них установлена ​​правильная версия iOS и они соответствуют другим требованиям.

Поиск ваших UDID

Вы можете использовать iTunes для получения UDID вашего устройства. Пошаговое руководство по процессу получения см. на странице WhatsMyUDID.com.

Основные шаги:

  1. Откройте iTunes на своем Mac.
  2. Подключите устройство (iPhone, iPad и т. д.) к компьютеру.
  3. В iTunes выберите устройство.
  4. Вы должны увидеть экран с именем устройства, емкостью и другими сведениями об устройстве. Чтобы отобразить UDID, щелкните поле Серийный номер.
  5. Скопируйте и вставьте UDID в документ, откуда вы сможете получить его позже.
  6. Закройте iTunes и отключите устройство.

Добавить UDID на портале разработчиков Apple

Чтобы добавить UDID вашего устройства на портал Apple Developer Portal:

  1. Нажмите на раздел Все в разделе Устройства в левом столбце портала разработчиков Apple.
  2. Чтобы добавить новый UDID, нажмите кнопку «Добавить» (+) в правом верхнем углу.
  3. Дайте устройству имя, которое вы узнаете, и скопируйте и вставьте UDID, полученный из iTunes, в поле UDID.
  4. Нажмите Продолжить.

Повторите шаги для каждого из ваших устройств.

Создать идентификатор приложения

Теперь, когда вы создали сертификат iOS, вы можете создать идентификатор приложения:

  1. В левом столбце портала разработчиков Apple нажмите Идентификатор приложения.

  2. На панели Регистрация идентификаторов приложений iOS в правом верхнем углу нажмите кнопку «Добавить» (+).

  3. В области Регистрация идентификатора приложения введите следующую информацию:
    1. Описание идентификатора приложения: название вашего приложения без специальных символов.
    2. Суффикс идентификатора приложения. Если вы собираетесь использовать определенные службы, такие как Game Center или In-App Purchases, создайте явный идентификатор. Если вам не нужны эти службы, создайте подстановочный идентификатор приложения. Подстановочный идентификатор приложения позволяет повторно использовать идентификатор приложения для нескольких проектов.
    3. Службы приложений: необязательно. Укажите, планируете ли вы использовать какие-либо службы приложений Apple.

    Дополнительную информацию о регистрации идентификатора приложения см. в разделе Ведение идентификаторов, устройств и Профили.

  4. Нажмите кнопку Продолжить.

  5. На странице Подтвердите идентификатор приложения проверьте предоставленную информацию и нажмите кнопку Отправить.

Создайте профиль обеспечения

Следующим шагом является создание файла .mobileprovision. Файл .mobileprovision объединяет ваш сертификат p12, идентификатор приложения и идентификаторы UDID устройств, на которых вы тестируете свое приложение.

  1. На портале Apple Developer нажмите Сертификаты, идентификаторы и профили.
  2. В левом столбце портала разработчиков Apple в разделе Профили подготовки выберите Все.
  3. Чтобы добавить новый профиль подготовки, нажмите кнопку «Добавить» (+) в правом верхнем углу.
  4. В разделе Разработка выберите тип профиля обеспечения для создания и нажмите Продолжить.
    Примечание. Если вы только начинаете, вам следует использовать дистрибутив > сертификат Ad Hoc, так как это позволит вам создать игру и протестировать ее. на устройствах.
  5. Выберите идентификатор приложения для разработки и нажмите кнопку Продолжить.
  6. Выберите один или несколько сертификатов разработки и нажмите кнопку Продолжить.
  7. Выберите одно или несколько устройств и нажмите кнопку Продолжить.
  8. Введите имя профиля и нажмите кнопку Создать.
  9. Нажмите Готово.

Загрузите сгенерированный файл .mobileprovision на свой настольный компьютер.

Настройка приложения для iOS

Чтобы настроить iOS Cloud Build, вам потребуются следующие элементы:

  • Ваш профиль обеспечения (.mobileprovision)
  • Ваш файл .p12
  • Пароль для вашего файла .p12

Для базового использования iOS этого процесса должно быть достаточно. Для проектов, включающих платформы Xcode, необходимо выполнить дополнительную настройку.

Использование фреймворков Xcode

Чтобы добавить платформы Xcode вручную, используйте API управления Xcode. API позволяет управлять внешними платформами Xcode.

Пример проекта Unity, использующего API, см. в UpdateXcodeProject пример проекта на BitBucket. Вы можете использовать этот пример для экспериментов и обучения.

Одним из подключаемых модулей примера проекта является внешняя библиотека DLL для управления проектом Xcode. DLL — это продукт сборки исходного кода, доступный в репозитории Unity Bitbucket. Предпочтительный способ включить функциональность управления проектом Xcode — скопировать файлы исходного кода C# в папку Assets/Editor в вашем проекте.

Вы можете использовать Xcode Manipulation API следующими способами:

  • Используйте встроенный атрибут Unity PostProcessBuildAttribute, который выполняется до запуска метода постэкспорта Unity Cloud Build.
  • Используйте метод сборки Unity Cloud после экспорта (требуется доступ к дополнительным настройкам).

How to build for ios from unity on windows

There are different way to build for ios from unity on windows.

Disclaimer: Running any macOS on non-Apple hardware is against the Apple EULA. Please acknowledge the risk and proceed on your own responsibility.

 Xcode Method:

While installing Unity, don’t skip to check «iOS deployment» and your Unity (on Windows) will be ready to build an Xcode project.

Next, just assign this Xcode project on a Mac with Xcode installed and you will be ready to compile the project to be run on your iOS device.

Complete Tutorial here https://medium.com/@ryoichirooka/unity-ios-on-windows-deploying-to-iphone-from-within-unity-editor-on-windows-machine-using-vmware-15eb7cbcbf83




Unity Asset:

iOS Project Builder for Windows

No longer need to switch to your Mac and fire up Xcode to build your games for iOS. Save time and build them directly from Windows.

screenshot 

This one-stop build tool takes as input:
— an Xcode project directory created by Unity
— (optionally) a digital signing identity
…and creates an IPA package of your iOS app and immediately serves it for OTA (over the air) deployment, AND a .deb package of your iOS app ready to be deployed with Cydia. Upload your fresh app instantly to any iOS device connected to your network!

Debug made simple
The Remote Debug Console receives all your application logs and displays them live on your computer’s screen, while your app is running on your device. Even stack dumps are transferred when it crashes !

No jailbreak needed!
Simply reuse your digital signing identity from Apple’s iOS Developer Program (or create a new one). If your device is jailbroken, it’s even simpler: in this case, no signing identity is required.

Using the Unity Developer Dashboard to configure Unity Cloud Build for Plastic

Cloud Build helps you automate the process of building your Unity Project for iOSApple’s mobile operating system. More info
See in Glossary
devices.

This article describes the prerequisites necessary to build your Project for iOS and create the supporting components to configure Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary
. Topics covered include:

  • Joining the Apple Developer Program
  • Creating an iOS certificate and p12 file
  • Adding devices to your profile
  • Creating a provisioning profile
  • Configuring your app to build for iOS

Joining the Apple Developer Program

To develop iOS apps, you must be a member of the Apple Developer Program. This lets you build, test, and eventually release your apps in the Apple App Store.

Note: You must have an Intel-based Mac running OS X Yosemite (v10.10) or later to develop and distribute iOS apps and Mac apps.

After you sign in to the Apple Developer program portal, you’ll see a list labeled Program Resources on the left. Click Certificates, IDs & Profiles to manage the certificates, identifiers, profiles, and devices you need to develop and distribute apps.

Provisioning profiles

A provisioning profile ties developers and devices to an authorized Development Team and enables you to use a device for testing. You must install a Development Provisioning Profile on each device you plan to run your application code.

Each Development Provisioning Profile contains a set of Development Certificates, Unique Device Identifiers (UDID), and an App ID.

To use a device for testing, you must also include your Development Certificate in the profile. A single device can contain multiple provisioning profiles.

Components of a provisioning profile

Certificates determine whether your app is development-only or a release candidate for the App Store. You should use an Ad Hoc Production Certificate so that you can test all the features of your game (such as GameCenter).

Identifiers are the unique IDs that identify your project. For basic projects, or if this is your first iOS project, you should make an App ID. This is often the same as your Unity3D Project’s Bundle ID.

Tip: For more information on signing identities and certificates, see Maintaining Your Signing Identities and Certificates on the Apple developer website.

Devices are the hardware—such as an iPhone, iPad, or iPod—on which you plan to test your project. You must retrieve the UDID for each device on which you plan to test your game. You then add the UDID to the Devices section in the iOS developer portal.

Note: Each year, you can register a fixed number of devices. The maximum number of devices you can register is 100 devices per product family per membership year. For more information see, Registering Devices Using Your Developer Account in the Maintaining Identifiers, Devices, and Profiles topic on the Apple developer website.

Creating an iOS certificate and p12 file

When you create a certificate, you must decide whether to create a Development Certificate (used only for testing), or a Production Certificate, which you use to distribute your app via the App Store.

Tip: Create a Production Certificate. While either certificate type works for development, Production Certificates make it easier to release your app to the App Store.

Create a certificate

  1. Sign in to your Apple Developer Program.
  2. Click Member Center > Certificates > Identifiers & Profiles > Certificates.
  3. In the left-hand column, under Certificates, click All.
  4. In the screen labeled What type of certificate do you need, choose the type of certificate to generate. Typically, if you’re starting, you should to pick an App Store and Ad Hoc production certificate.
  5. Use the Keychain Access program on your Mac (open your Finder and find it in Applications/Utilities) to generate a Certificate Signing Request (CSR) file. Follow the instructions in the iOS portal to complete this step. Make a note of where you save the CSR file.
  6. In the Generate your certificate screen, upload your CSR file (which might have the extension .certSigningRequest). Click the Choose File button and select your CSR file, and then click the Generate button.
  7. To download your certificate to your Mac, click the Download button on the Your Certificate is Ready screen. Store this file somewhere safe and back it up.

To add the certificate to a keychain, locate the certificate file and double-click it. This opens the Keychain Access program. If you get a popup with the message “Do you want to add the certificate to a keychain?”, choose login and click the Add button.

Export a p12 file

To create apps using Unity Cloud Build, you must convert your certificate file to a p12 file. A p12 file is a file that contains your private key and certificate and is used to sign your code. Typically, if you develop a project in native Xcode, this process is handled behind the scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

To generate a p12 file:

  1. On your Mac, open up your Finder and in Applications/Utilities, open the Keychain Access program.

  2. In the left-hand column, under keychains, verify that Login is selected.

  3. In the left-hand column, under Category, verify that My Certificates is selected. In the main Keychain Access pane, select your certificate.

    Note: Typically, your certificate is located under My Certificates. If it is not there, check under Certificates.

  4. From the File menu, select File > Export Items, or right-click and select Export.

  5. Select Personal Information Exchange (.p12) from the File Format drop-down menu.

    Note: If Login under Keychains and My Certificates under Category is not selected, the p12 option is greyed out.

  6. Ceate a password for the p12 file.

    Note: Record the password somewhere safe as you must supply it when setting up iOS builds on Unity Cloud Build.

Adding devices

For development purposes, Apple requires the UDID for each device on which you intend to install your app. Once your app is accepted into the App Store, anyone can download and install it; provided they have the correct version of iOS and meet any other requirements.

Finding your UDIDs

You can use iTunes to retrieve the UDID of your device. For a walkthrough of the retrieval process, see WhatsMyUDID.com.

The basic steps are:

  1. Open iTunes on your Mac.
  2. Connect the device (iPhone, iPad, etc) to the computer.
  3. In iTunes, select the device.
  4. You should see a screen with the device name, capacity, and other details about the device. To display the UDID, click the Serial # field.
  5. Copy and paste the UDID into a document where you can retrieve it later.
  6. Close iTunes and disconnect your device.

Add the UDID in the Apple developer portal

To add your device UDID(s) to the Apple Developer Portal:

  1. Click the All section under Devices in the left column of the Apple Developer Portal.
  2. To add a new UDID, click the Add button (+) in the upper-right corner
  3. Give the device a name you will recognize, and copy-paste the UDID you got from iTunes into the UDID field.
  4. Click Continue.

Repeat the steps for each of your devices.

Create App ID

Now that you’ve created your iOS Certificate, you can create an App ID:

  1. In the left-hand column of the Apple Developer Portal, click App ID.

  2. In the Register iOS App IDs pane, at the top right, click the Add button (+).

  3. In the Registering an App ID pane, enter the following information:
    1. App ID Description: The name of your app, without any special characters.
    2. App ID Suffix: If you intend to incorporate specific services such as Game Center or In-App Purchases, create an Explicit ID. If you don’t need these services, then create a Wildcard App ID. A Wildcard App ID lets you re-use the App ID for multiple projects.
    3. App Services: Optional. Indicate whether you plan to use any of the Apple App Services.

    For more information on registering an App ID, see Maintaining Identifiers, Devices, and Profiles.

  4. Click the Continue button.

  5. On the Confirm your App ID page, check the information you’ve provided and then click the Submit button.

Create a provisioning profile

The next step is to generate a .mobileprovision file. The .mobileprovision file combines your p12 certificate, App ID, and identifies the UDIDs of the devices on which you are testing your app.

  1. In the Apple Developer portal, click Certificates, IDs & Profiles.
  2. In the left-hand column of the Apple Developer Portal, under Provisioning Profiles, select All.
  3. To add a new Provisioning Profile, click the Add button (+) in the upper-right corner.
  4. Under Development, select the type of provisioning profile to create and click Continue.
    Note: If you’re just getting started, you should use a Distribution > Ad Hoc certificate, as this lets you build your game and test it on devices.
  5. Select the App ID to use for development, and click the Continue button.
  6. Select one or more development certificates, and click the Continue button.
  7. Select one or more devices, and click the Continue button.
  8. Enter a profile name, and click the Generate button.
  9. Click Done.

Download the generated .mobileprovision file to your desktop machine.

Configuring your app to build for iOS

To configure your iOS Cloud Build, you need the following items:

  • Your provisioning profile (.mobileprovision)
  • Your .p12 file
  • The password for your .p12 file

For basic iOS usage this process should be sufficient. For projects that include Xcode frameworks, you must perform some additional configuration.

Using Xcode Frameworks

To add Xcode frameworks manually, use the Xcode Manipulation API. The API lets you manage external Xcode frameworks.

For an example of a Unity Project that uses the API, see the UpdateXcodeProject example Project on BitBucket. You can use the example to experiment and to learn from.

One of the plugins of the example Project is an external Xcode project manipulation DLL. The DLL is the build product of the source available in Unity’s Bitbucket repository. A preferred way to include Xcode project manipulation functionality is to copy the C# source code files to the Assets/Editor folder in your Project.

You can use the Xcode Manipulation API in the following ways:

  • Use the built-in Unity PostProcessBuildAttribute, which is executed before the Unity Cloud Build Post-Export method runs.
  • Use the Unity Cloud Build Post-Export method (requires access to advanced settings).

Using the Unity Developer Dashboard to configure Unity Cloud Build for Plastic

Copyright © 2020 Unity Technologies

优美缔软件(上海)有限公司 版权所有

«Unity»、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。

Как скомпилировать билд Unity3D проекта для IOS на Windows?
Билд для IOS всегда стоял особняком в Unity3D. Если все остальные можно было компилировать на Windows машинах, то для IOS обязательно нужен был Мак. Я как и все столкнулся с этой проблемой при попытке выпустить свой первый проект на IOS, которая казалась мне трудно преодолимой. Однако, совсем недавно произошло два события которые делают эту проблему практически неактуальной, и которые прошли на Хабре незамеченными.

Как было до этого?

Раньше чтобы скомпилировать проект необходимо было:

  1. установить Unity3D на Мак или Хакинтош;
  2. скопировать туда свой проект с Windows;
  3. скомпилировать из него проект для Xcode;
  4. открыть полученный проект в Xcode и упаковать его в ipa файл;
  5. отправить тестерам или в Appstore.

Соответственно, проблемы синхронизации проектов между Windows и Mac версиями Unity3D давали о себе знать и для комфортной работы необходимо было покупать б/у Мак или мучиться с виртуальными машинами.

Кстати, к своему стыду установить хакинтош на VirtualBox у меня так толком и не получилось.

Что же такого произошло, что кардинально изменило ситуацию?

Новый Хакинтош!!!

Не знаю почему, но тема Хакинтоша не поднималась на Хабре уже пару лет. Рутрекер нас тоже особо не балует, но пару недель назад там появился готовый образ Хакинтоша для VMware причём для последней версии 10.9 Маверик. Всё работает на VMware Workstation 10.x, что называется прямо из коробки и без всяких проблем. Ссылки не даю, кому надо тот и сам легко найдёт.

Unity3D 4.3

Хотя недавно была небольшая статья с обзором новой версии Unity3D, но в ней никто не обратил внимание на ключевое нововведение:

Ability to build iOS target in Windows! It’s still necessary to compile resulting Xcode project on a Mac.

Да-да!!! Теперь файлы для Xcode можно компилировать прямо в Windows версии!!! Соответственно про пункты 1, 2 и 3 можно теперь забыть.
Т.е. теперь почти всю работу с проектом можно выполнять в Windows, а Мак нужен лишь для упаковки проекта, которая занимает по времени несколько минут, и для которой достаточно виртуальной машины с Хакинтошем!!!

Краткое руководство для тех, кто этим раньше не занимался

Для компиляции рабочего билда и запуске его на своём устройстве необходимо всего три вещи:

  1. Unity3D 4.3 — для компиляции Xcode проекта
  2. Mac OS X с установленным Xcode — для упаковки Xcode проекта в ipa файл
  3. Аккаунт IOS разработчика — для создания сертификатов и провижин профайла, необходимого для подписи ipa файла

Сам процесс компиляции достаточно прост и интуитивно понятен, но для тех кто раньше этим не занимался я всё-таки напишу краткое руководство.

В настройках проекта вводите Bundle ID, который вы указали при создании провижин профайла.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Билдите проект.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Полученные файлы переносите на Мак машину и открываете с помощью Xcode.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Архивируете проект Product->Archive.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Для подготовки архива для распространения нажимаете на Distribute.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Если вы ещё не готовы отправлять приложение в Appstore, то выбираем 2-й пункт.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Выбираете свой провижин профайл и жмёте Export.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

После чего указываете куда сохранять файл.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

После чего генерируется долгожданный ipa файл.
Как скомпилировать билд Unity3D проекта для IOS на Windows?

Теперь можете устанавливать его на свои устройства через свой Itunes или Testflight.

Автор: malan

Источник

Понравилась статья? Поделить с друзьями:
  • Сбой запроса дескриптора usb устройства windows 10 как исправить джойстик
  • Сборка windows 7 x64 с драйверами скачать торрент
  • Сбой подключения с ошибкой 734 windows 10
  • Сборка mingw в windows своими руками
  • Сбой запроса дескриптора usb устройства windows 10 исправление ошибки