@Given("^I wait for manual attachment of the debugger$") public void wait_for_manual_attachment_of_debugger() throws InterruptedException {
  while (!Debug.isDebuggerConnected()) {
    Thread.sleep(1000);
  }
}

@ Given ( "^I wait for manual attachment of the debugger$" ) public void wait_for_manual_attachment_of_debugger ( ) throws InterruptedException { while ( ! Debug . isDebuggerConnected ( ) ) { Thread . sleep ( 1000 ) ; } }
wait for the debugger to be manually attached to this running process . use this to debug test execution by adding this step to your test scenario and when the test is running in android studio choose menu " run - attach debugger to android process " , finally select the name of your app package from the list of processes displayed .
