This document describes slave-specific setup for Cordova Medic for running builds on each platform.
Since the build process writes and rewrites many files to the file system of the slave machine, the slave directory should be excluded from the operating system's file system indexing process to avoid disk thrashing. This can be accessed by changing Disk Indexer settings on Windows, or changing Spotlight Privacy settings on OS X.
Disable machine sleep so that the slave is always on.
Enabling a screen saver has been observed to interfere with running emulators. Disable screen savers to avoid this problem.
For iOS slaves, Xcode is required. It can be obtained from the Apple App Store, which requires an Apple ID. For deployment to physical devices, a valid Apple Developer license is also necessary.
Two special NPM packages are also required for Medic builds on iOS: ios-sim
and ios-deploy
. You can install them by running the following command with root/Administrator privileges:
npm install -g ios-deploy ios-sim
To run Appium tests on real iOS devices you may need to install ios-webkit-debug-proxy. If you don't have Homebrew installed, please install according to the Homebrew docs.
When you've got Homebrew installed, just run the following commands:
> brew update
> brew install ios-webkit-debug-proxy
More info on installing ios-webkit-debug-proxy can be found in Appium docs.
For Android slaves, the Android SDK is required, and can be installed with Android Studio as described here or without Android Studio as described here. Alternatively (but only if the slave is running Windows) all tools required for Cordova can be installed in bulk using the the VS tools for Cordova.
To make the Android commands available on the command line, set the following environment variables:
ANDROID_HOME
, equal to the absolute path to the Android SDK directoryPATH
, extended to containANDROID_HOME/tools
andANDROID_HOME/platform_tools
Once the SDK base is installed, actual tools and libraries can be installed by running:
android
Select and install the tools and SDK appropriate for the latest version of Android supported by Cordova. Usually these are the latest set of tools that are automatically selected by running android
. Alternatively, if you execute cordova build
without the proper SDK installed, the build process will terminate with a message telling you which version of the Android SDK it needs.
For emulation, at least one Android Virtual Device should be available, which can be created by running:
android avd
Note: Due to an existing issue, configure the AVD such that it has an SD card with space greater than 0KB.
If you're using Ant to build, you will also need it to be installed. The official Ant installation instructions are here.
For Windows slaves, Visual Studio is required. For deployment to devices, a Windows Developer License is also required. To install a license, run the following from PowerShell:
Show-WindowsDeveloperLicenseRegistration
In order for medic to be able to gather and display detailed logs when running windows store apps, you'll also need to enable some of the windows logs channels. Please run the following commands in a command prompt with administrator privileges:
wevtutil set-log "Microsoft-Windows-AppHost/Admin" /e:true /rt:true /ms:4194304
wevtutil set-log "Microsoft-Windows-AppHost/ApplicationTracing" /e:true /rt:true /ms:4194304
There is an installation of Buildbot running on Apache Infrastructure, which can be reached at ci.cordova.io, and which also runs Medic builds. To connect a slave to this master, the following few extra steps are required:
-
The slave needs to be defined in
master.cfg
in the Apache Infrastructure SVN repository (this requires Cordova committer access) -
Credentials for connecting to the master need to be obtained via a JIRA ticket to the Apache Infrastructure team
-
The slave needs to be configured to connect to the Apache master, which can done either:
a. By modifying an existing slave's
buildbot.tac
to point to the Apache master and use the given password OR b. By creating a new slave with a dummy password*, and then editing the slave'sbuildbot.tac
*WARNING: The real password should not be passed as a CLI parameter when creating a new slave because then the password would be exposed in shell history