Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Test cases not working in debug mode

I am not able to debug android Instrumentation test cases (using espresso & UiAutomator)

But earlier test cases the debugging was working fine but with recent update it is not working anymore. It gets always struck up at instantiating unit test enter image description here

I can see in command window that it's trying to launch PACKAGE_NAME**.test**

 adb shell am instrument -w -r   -e debug true -e class PACKAGE_NAME.LanguageScreenTest#testSelectImportant PACKAGE_NAME**.test**/android.support.test.runner.AndroidJUnitRunner
like image 881
Ankur Avatar asked Aug 19 '16 08:08

Ankur


People also ask

How do I run Android in debug mode?

Press Ctrl + Alt + F5 (or Shift + F9 ) to launch the app in debug mode. Choose Run -> Attach to process and select the signature of an app to enable the debug mode, which is already installed via adb.

Can we debug test cases?

Debug mode​ Open a test case and switch to the Script view. Double-click on the leftmost side of the script editor to mark a breakpoint. A breakpoint is where Katalon Studio pauses the test execution for you to start debugging. Choose a browser for Debug from the main toolbar.

How do I run a JUnit test case in debug mode?

In the case of a test failure you can follow these steps to debug it: Double click the failure entry from the Failures tab in the JUnit view to open the corresponding file in the editor. Set a breakpoint at the beginning of the test method. Select the test case and execute Debug As>JUnit Test from the Debug drop down.


1 Answers

The same thing for me in case i use AndroidOrchestrator. Turn it off if you dont really need to run the tests with it or, at least, when you want to debug.

(It has been so long time but just for the others who may fall latterly into this problem)

like image 81
Phạm Lam Avatar answered Oct 29 '22 19:10

Phạm Lam