Last active
August 29, 2015 14:21
-
-
Save stefanhoth/ca234ed53386a9ff114d to your computer and use it in GitHub Desktop.
Allow gradle to only use devices that meet your criteria
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
... | |
deviceProvider new AwesomeDeviceProvider(getAdbExe()) | |
} | |
class AwesomeDeviceProvider extends com.android.builder.testing.ConnectedDeviceProvider { | |
AwesomeDeviceProvider(File adbLocation) { | |
super(adbLocation) | |
} | |
public String getName() { | |
return "awesome" | |
} | |
public List<? extends com.android.builder.testing.api.DeviceConnector> getDevices() { | |
List localDevices = super.getDevices() | |
localDevices.grep { | |
it.getApiLevel() > 16 && | |
it.iDevice.getProperty("ro.product.manufacturer") == 'Genymotion' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment