Skip to content

Latest commit

 

History

History
80 lines (62 loc) · 3.3 KB

PrepareMac.md

File metadata and controls

80 lines (62 loc) · 3.3 KB

Prepare your Mac

In order to be able to compile Swift iOS apps for Android you will need to have:

  • Official Swift 5.4.2 Toolchain for Xcode
  • Swift Android Toolchain & Gradle Plugin
  • Android NDK r21e
  • JDK 8
  • Precompiled Swift Mutata Libraries
  • Precompiled Mutata Android Libraries
  • HomeBrew, CMake and other tools
  • Android Studio & Command Line Tools

Automated Install Steps

# Clone this repo (MutataApp)
git clone https://github.com/kodika/MutataApp
cd MutataApp
export MUTATA_ROOT_PATH=$PWD

# Prepare your Mac
./scripts/01-PrepareMac.sh

# Download latest Swift Android Toolchain, Mutata Swift and Android Libraries.
./scripts/02-DownloadLatestLibs.sh

# Download the Android NDK r21e from Google
./scripts/03-DownloadNdk.sh

Manual Install Steps

We suggest that you use the Automated Install Steps that we have prepared to ensure that you have the correct tools and versions but, below are the detailed instructions for each step/tool.

Official Swift 5.4.2 Toolchain for Xcode

Mutata is using the official Swift 5.4.2 toolchain for Xcode which you can download from https://swift.org/builds/swift-5.4.2-release/xcode/swift-5.4.2-RELEASE/swift-5.4.2-RELEASE-osx.pkg

Swift Android Toolchain + Gradle Plugin

In order to make the compilation of Swift and the integration with Gradle easier, Readdle has created a Gradle Plugin that integrates with the Swift Android Toolchain.

Android NDK

cd $MUTATA_ROOT_PATH
wget https://dl.google.com/android/repository/android-ndk-r21e-darwin-x86_64.zip
unzip android-ndk-r21e-darwin-x86_64.zip
rm -rf android-ndk-r21e-darwin-x86_64.zip

JDK 8

You will need JDK 8 to be able to compile the Android project.

brew search openjdk
brew install openjdk@8

Mutata Libraries

In order to support the iOS frameworks on Android devices, you will need to have the Mutata libraries and Mutata Swift Android Toolchain, which can be downloaded from Mutata Libraries Releases.

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

CMake, Gradle and other tools

You will need to have CMake and other open-source tools to use the Mutata scripts.

brew install coreutils cmake wget gradle

Android Studio & Command Line Tools

Download and install Android Studio from https://developer.android.com/studio and then, install Command Line tools and Android 11 Platform tools.