android-studiogradleinstrumented-test

./gradlew connectedVariantNameAndroidTest failed


At Android studio's terminal key in "./gradlew connectedVariantNameAndroidTest". Result with following error message:

Task :app:connectedDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:connectedDebugAndroidTest'.

com.android.builder.testing.api.DeviceException: No connected devices!

Why?


Solution

  • com.android.builder.testing.api.DeviceException: No connected devices!

    From error message, you should connect a device using usb or a virtual device.