Skip to main content

Guidance for Developing Apple iOS and Vision Pro Applications with Unity on Amazon EC2

Overview

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.

How it works

This architecture diagram shows how to build Unity-based Apple Vision Pro and mobile projects for iOS in the AWS Cloud. The build process uses a two-step approach, using an auto-scaled fleet of Amazon Elastic Compute Cloud (Amazon EC2) Spot Instances and Amazon EC2 Mac Instances, to achieve flexibility and cost-efficiency within the pipeline.

Deploy with confidence

Ready to deploy? Review the sample code on GitHub for detailed deployment instructions to deploy as-is or customize to fit your needs. 

Go to sample code

Well-Architected Pillars

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.

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.

Read the Operational Excellence whitepaper 

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.

Read the Security whitepaper 

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.

Read the Reliability whitepaper 

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.

Read the Performance Efficiency whitepaper 

This Guidance minimizes compute costs by strategically using Amazon EC2Mac 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.

Read the Cost Optimization whitepaper 

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.

Read the Sustainability whitepaper 

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.