So, this is more of a workaround than a real solution, but it should give you a debugger back, which is probably 90% of the cost:
You can run a test suite, for example:
./gradlew <module>:test --debug-jvm
And the jvm running your tests will be paused until the debugger arrives.
From Android Studio, pick up the action selection element by pressing ctrl + shift + a (anyway, on linux, check the equivalent of your OS) and select:
Bind to local process ...
As soon as the Android Studio application starts running the tests, it starts working.
The --debug-jvm flag can be used with --tests to debug a single test:
./gradlew <module>:test --tests fully.qualified.test.Test --debug-jvm
source share