It's also possible to attach the debugger to that process executing your Robolectric tests by simply choosing Debug instead of Run. However, you might face this error:
Error running android-app:appname [test]: Unable to open debugger port : java.net.SocketException "Socket closed"In order for the debugger to attach you need to uncheck "Use in-process build" in the settings menu for Android Studio under Compiler → Gradle.
Thanks! This really saved my day.
AntwortenLöschen