How do you run
./gradlew connectedAndroidTest -DconnectedAndroidTest.device=XXXX
It's not supported. The documentation for
connectedCheck at http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Android-tasks, which delegates to
connectedAndroidTest for these sorts of on-device non-UI-automated tests, explicitly states:
Runs checks that requires a connected device or emulator. They will run on all connected devices in parallel.
There is a feature request for the ability to select individual devices; you can track its progress at https://code.google.com/p/android/issues/detail?id=66129