6

This may be a simple question. I have a client who has a significant presence/infrastructure within AWS. Starting up a new mobile app for the client and they have said they would like to utilize the AWS toolset as much as possible. However, after going through all the documentation for some such tools as AWS CodeBuild, I don't see how I would be able to build an iOS app on the platform. Have I missed something, can you use the AWS toolset such as AWS CodePipeline and AWS CodeBuild to automate the builds of iOS and Android apps from a React Native base?

My belief is that you are limited to only Android because you would not have a MacOS-based server to actually compile the underlying iOS code.

Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52

2 Answers2

1

Codebuild uses docker to create build environments. AWS create a whole bunch of docker images for regular development purposes, a full list of which is here.

If you need to customise a build environment, or create something totally unique, that's no problem. Just create the docker image you want to use as a build environment (for example a MacOS server), upload it to Amazon EC2 container registry and then reference that image in CodeBuild. Details on that can be found here.

Build environments are Docker images that include a complete file system with everything required to build and test your project. To use a custom build environment in a CodeBuild project, you build a container image for your platform that contains your build tools, push it to a Docker container registry such as Amazon EC2 Container Registry (ECR), and reference it in the project configuration. When building your application, CodeBuild will retrieve the Docker image from the container registry specified in the project configuration and use the environment to compile your source code, run your tests, and package your application.

EDIT: See comments below. As docker doesn't currently support MacOS images, and iOS apps basically require MacOS hosts for building, I would conclude its not possible to build iOS apps on Codebuild.

F_SO_K
  • 13,640
  • 5
  • 54
  • 83
  • Yes, I had seen the first one (Docker Images) but nothing there or reading your other link leads me to believe I could create a Docker image that would encapsulate a MacOS image as Docker cannot simulate a Mac OS in a Docker container. – Perry Hoekstra Apr 25 '18 at 15:52
  • Looks like you're right. Docker only runs images with Linux or Windows kernals, so doesn't support MacOS images. So given the AWS answer above that 'Build environments are Docker images' I would conclude you can't build iOS apps on Codebuild. – F_SO_K Apr 25 '18 at 16:54
  • I'm trying to setup only my Android build (not the iOS one) on CodeBuild, is there any good approach to this? – Divyansh Goenka Feb 14 '19 at 10:47
1

You can use Jenkins builds system having MacOS as an agent to work with CodeBuild. You CodeBuild can use Jenkins build system to compile to ios code.

  • I've done this and it's terribly involved. Plus I had issues with Jenkins (running in cloud) talking to the remote Mac Mini build agent. Just know there are caveats. – SaundersB May 25 '20 at 16:31
  • @SaundersB do you have any docs on how to do that? im in the same project as OP – J. Doe Jul 20 '22 at 16:26