[SEO Subhead]
This Guidance demonstrates how developers can build applications on mobile iOS and Apple Vision Pro in the AWS Cloud using Unity—a widely-used game engine and development platform where developers can create immersive 2D and 3D interactive experiences. Amazon EC2 Mac instances are used to provide the necessary macOS environment to run Xcode, allowing developers to use Apple tools and workflows required to build, compile, and package applications for iOS and visionOS platforms. By automating the build process on scalable and cost-efficient AWS infrastructure, developers can significantly reduce the time and effort required to package applications for mobile and extended reality devices.
Note: [Disclaimer]
Architecture Diagram

[Architecture diagram description]
Code Repository and Jenkins Integration:
Step 1
The source code is stored in a Git code repository. Jenkins pulls the source code from the repository to initiate a build. Developers access the Jenkins Controller interface through an Application Load Balancer.
Developer and Administrator Access:
Step 2
Developers and System Administrators access Amazon EC2 Mac Instances through an Apple Remote Desktop (ARD). They access Linux agents through SSH, and the Unity Accelerator through HTTP with AWS Systems Manager.
Infrastructure Management:
Step 3
System Administrators deploy and manage the infrastructure using the AWS Cloud Development Kit (AWS CDK).
Jenkins Controller Deployment:
Step 4
The Jenkins Controller is deployed on AWS Fargate for Amazon Elastic Container Service (Amazon ECS) using the AWS CDK. Amazon Elastic File Service (Amazon EFS) is to support redundancy.
Build Stage on Spot Instances:
Step 5
The first build stage, which involves generating the Xcode project from the Unity source code, is run on Amazon Elastic Compute Cloud (Amazon EC2) Spot Instances. The Spot Instances are placed into an Amazon EC2 Auto Scaling group for scalability and redundancy.
Jenkins Agent Instances and Caching:
Step 6
Jenkins agent instances use Amazon Elastic Block Storage (Amazon EBS) volumes and Amazon Simple Storage Service (Amazon S3) for repository and build asset caching mechanics. The Unity Accelerator can also be used for Unity asset caching.
Final Build and Artifact Storage:
Step 7
The resulting Xcode project is transferred to a Jenkins worker hosted on one of the Amazon EC2 Mac Instances to finalize, sign the build, and export the artifact. The .ipa or Xcode archive file is exported as a Jenkins artifact and stored in an Amazon S3 bucket.
Secure Storage of Credentials:
Step 8
Certificates, private keys, and provisioning profiles are stored in AWS Secrets Manager and dynamically pulled onto the Mac instances during the build process.
Get Started

Deploy this Guidance
Well-Architected Pillars

The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
This Guidance uses Amazon CloudWatch, AWS CDK, and Amazon Key Management Service (AWS KMS) to provide a consistent and repeatable way to deploy the Amazon EC2 and Jenkins resources, reducing human error and lead time. For example, AWS CDK allows defining the entire deployment, from the Amazon EC2 instances to the Jenkins setup, in a programmatic manner. This enables version control, testing, and easy updates of the pipeline infrastructure. Additionally, AWS CDK simplifies the management and upgrades of the pipeline components over time, reducing operational overhead and helping to ensure the environment stays up-to-date. Additionally, CloudWatch provides observability on the workloads to proactively identify issues, while AWS KMS is used to create encryption keys and store secrets for the pipeline, encrypting data at rest.
-
Security
The capabilities of Amazon Virtual Private Cloud (Amazon VPC), AWS KMS, AWS PrivateLink, and Systems Manager help ensure the certificates and provisioning profiles are securely stored and accessed only during the build process. Container images are restricted within the private Amazon VPC, and PrivateLink controls Amazon S3 bucket access. Lastly, Systems Manager provides controlled access to the pipeline resources and stores audit logs.
-
Reliability
The Application Load Balancer, EC2 Auto Scaling groups, Amazon EFS, and Fargate are services that collectively offer consistent ingress to the Jenkins web UI. The Jenkins UI uses Amazon EFS for shared storage and runs on Fargate for automatic restarts. Moreover, EC2 Auto Scaling groups with mixed Spot Instances handle worker node failures and interruptions.
-
Performance Efficiency
This Guidance leverages a variety of AWS services to optimize the performance and cost-efficiency of the build process. For instance, Amazon Elastic Container Registry (Amazon ECR) simplifies container image storage and delivery, eliminating the need to manage separate registries. EC2 Auto Scaling groups are used to automatically scale the build workloads on cost-effective Spot Instances, taking advantage of unused capacity. Additionally, Amazon EBS volumes and the Unity Accelerator provide caching mechanisms to reduce overall build times by reusing critical build repositories, artifacts, and assets. By integrating these AWS services, this Guidance is able to improve the performance and cost-efficiency of developing Apple Vision Pro applications with Unity.
-
Cost Optimization
This Guidance minimizes compute costs by strategically using Amazon EC2 Mac Instances and Spot Instances. This is done by using Spot Instances for the initial project build phase and reserving the more powerful EC2 Mac instances for the final Xcode build step. Additionally, the EC2 Auto Scaling groups automatically scale the resources based on demand, and AWS Savings Plans help optimize costs for the services. By combining these cost-saving AWS capabilities, this Guidance is able to significantly reduce the overall compute expenditure for developing Apple Vision Pro applications with Unity.
-
Sustainability
EC2 Auto Scaling automatically scales resources up and down based on demand, minimizing excess capacity and reducing energy consumption. This Guidance also uses managed services like Amazon S3, Amazon EFS, and Systems Manager, which distribute the environmental impact across many users rather than requiring dedicated infrastructure. Additionally, it takes advantage of AWS Graviton Processors, which can improve the price-performance ratio and further minimize the hardware requirements, contributing to a more sustainable architecture.
Related Content

Implementing a Build Pipeline for Unity Mobile Apps
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.