apply plugin: 'devicefarm' def getAccessKeyDeviceFarm() { if (project.hasProperty('AWS_ACCESS_KEY_ID_DEVICE_FARM')) { return AWS_ACCESS_KEY_ID_DEVICE_FARM } else { println("Could not locate AWS_ACCESS_KEY_ID_DEVICE_FARM in gradle.properties") return "" } } def getSecretAccessKeyDeviceFarm() { if (project.hasProperty('AWS_SECRET_ACCESS_KEY_DEVICE_FARM')) { return AWS_SECRET_ACCESS_KEY_DEVICE_FARM } else { println("Could not locate AWS_SECRET_ACCESS_KEY_DEVICE_FARM in gradle.properties") return "" } } devicefarm { projectName "Mapbox GL Android" // required: Must already exists. devicePool "sanity" // optional: Defaults to "Top Devices" authentication { accessKey getAccessKeyDeviceFarm() secretKey getSecretAccessKeyDeviceFarm() } devicestate { wifi "on" bluetooth "off" gps "on" nfc "on" latitude 47.6204 // default longitude - 122.3491 // default } instrumentation { } }