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="[email protected]"
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/jenkins
folder for a Jenkins agent.
To save time, since it doesn't require any user interaction.
brew
to install various tools without sudorbenv
to manage ruby versions sudolessbundler
to manage installed ruby gems sudolessxcode-install
to install various versions of xcodejenv
to manage installed java versionsnvm
to manage node versions sudoless. usefull for cordova, phonegap, ionic, react nativejdk 8
latest 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="[email protected]"
export APPLE_PASSWORD="secret"
mobile-ci-update
Or if you need to update specific component:
export PASSWORD="osx_user_password"
export APPLE_USERNAME="[email protected]"
export APPLE_PASSWORD="secret"
mobile-ci-update xcode
Available 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_PASSWORD
xcode
- Installs the latest Xcode.⚠️ Requires env variablesPASSWORD
,APPLE_USERNAME
,APPLE_PASSWORD
brew
- 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-sdk
To 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="[email protected]"
XCODE_INSTALL_PASSWORD="secret"
xcversion install 9.3
sudo xcodebuild -license accept
Update all packages:
brew update
brew upgrade
⚠️ Use onlybundler
to manage gem versions.⚠️ Don't usesudo
when 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 version
To list installed java versions:
jenv versions
To change default java version:
jenv global 10
To change shell session default java version:
jenv shell 10