Building Android and iOS apps in the same job?

Hello, we have an ejected ExpoKit React Native app and we use CircleCI and fastlane to build the app for Android and iOS.

Currently to build for iOS, I need to use CircleCI’s macOS xcode:10.1.0 container, but for Android, I need to use the circleci/android:api-27-node image. So I have two separate jobs for the two builds, but they have most steps in common such as checkout, yarn install, bundle install, expo publish, etc. I always want to build both platforms together. I also want to consolidate into a single job so there’s just one git tag and one Slack announce.

I feel like I can build both in a single job if I can get the Android SDK onto the macOS Xcode container. Has anyone already figured this out? Is the only way to include a setup step to download and install the Android SDK each time?

I expect the circleci/android:* image won’t work on Mac OS, as the arch of that image will be wrong. At the very least you’d have to rebuild it.

Does Docker work natively on Mac these days? I wonder if you could create an Android image and run it in Docker, while doing your iOS work there too. You might run out of memory though… :roll_eyes: