Automatically downloads, installs and configures min needed software for a headless mobile CI box on OS X.
- A fresh installed OS X 10.10+
- User with admin rights
- Apple developer account (for Xcode)
- Internet connection
On your CI box login with the created user and execute:
export PASSWORD="osx_user_password"
export APPLE_USERNAME="apple.developer@mail.com"
export APPLE_PASSWORD="secret"
bash <(curl -s https://raw.githubusercontent.com/xfreebird/mobile-ci-bootstrap/master/mobile-ci-bootstrap.sh)At the end script execution you will have:
- iOS and Android ready build machine
- User writeable
/opt/ci/jenkinsfolder for a Jenkins agent.
To save time, since it doesn't require any user interaction.
brewto install various tools without sudorbenvto manage ruby versions sudolessbundlerto manage installed ruby gems sudolessxcode-installto install various versions of xcodejenvto manage installed java versionsnvmto manage node versions sudoless. usefull for cordova, phonegap, ionic, react nativejdk 8latest git
Never install code siging ceritificates in the login keychain. This will halt the codesiging process run by xcodebuild from ssh session. If you have any private key + certificate for app code signing installed in the login keychain, please remove them.
For CI jobs always use project's gradle wrapper, because different projects use different versions of gradle.
To update installed software you can use the mobile-ci-update utility. By default it will update the OSX, Xcode, Brew packages
export PASSWORD="osx_user_password"
export APPLE_USERNAME="apple.developer@mail.com"
export APPLE_PASSWORD="secret"
mobile-ci-updateOr if you need to update specific component:
export PASSWORD="osx_user_password"
export APPLE_USERNAME="apple.developer@mail.com"
export APPLE_PASSWORD="secret"
mobile-ci-update xcodeAvailable options are:
osx- Updates the OSX. It will not upgrade the OS for major releases (e.g. 10.11 -> 10.12)⚠️ Requires env variablesPASSWORD,APPLE_USERNAME,APPLE_PASSWORDxcode- Installs the latest Xcode.⚠️ Requires env variablesPASSWORD,APPLE_USERNAME,APPLE_PASSWORDbrew- Updates installed brew packages (e.g. swiftlint, rbenv)
In case you prefer upgrading the software manually.
Both the SDK and NDK have been installed using the brew cask. To upgrade the SDK or/and NDK version, run:
brew update
brew cask reinstall android-ndk
brew cask reinstall android-sdkTo manage Android SDK packages, please refer to Google's official documentation on how to manage the android sdk packages.
All installed Xcodes are following the Xcode-<version>.app naming convention.
The /Applications/Xcode.app is a symbolic link to the current default Xcode.
To install a new version of Xcode use xcode-install:
export XCODE_INSTALL_USER="apple.developer@gmail.com"
XCODE_INSTALL_PASSWORD="secret"
xcversion install 9.3
sudo xcodebuild -license acceptUpdate all packages:
brew update
brew upgrade⚠️ Use onlybundlerto manage gem versions.⚠️ Don't usesudowhen updating/installing gem packages, because ruby is managed byrbenv.
Don't rely on gem versions installed on the machine, alwas manage with bundler
Node versions are managed with nvm
npm comes with the installed node version.
For example, if the project need node.js 9 and cordova npm package, then it would execute:
nvm install 9
npm install -g cordova PHP packages are managed with easy_install
To update a package, run:
sudo easy_install --upgrade <package_name>The Java environment can be controlled with jenv.
A new java version:
jenv add '/path/to/java_home'To get current java versions:
jenv versionTo list installed java versions:
jenv versionsTo change default java version:
jenv global 10To change shell session default java version:
jenv shell 10