I have a problem in my test test (for which I use Robotium), so I decided to debug it. Usually I run a test from the command line using gradlew connectedAndroidTest , but it also runs from Android Studio (v0.8.14), choosing a specific gradle task. However, if I try to debug this gradle task, I get the error Unable to open debugger port : java.net.SocketException "socket closed" , and the test continues to work (without debugging). Is there any other way to debug a measurement test (with IDE) or am I missing something in my setup?
Update: However, it works on an emulator!

source share