Don't hit breakpoints by debugging Android Junit tests in Eclipse

Error starting Android unit test, which extends ActivityInstrumentationTestCase2 and therefore wants to try and debug the test. However, breakpoints are ignored, and when debugging as an Android Junit Test, it runs tests ...

Here's the console log:

[2011-03-16 17:02:54 - AppName] Launching instrumentation android.test.InstrumentationTestRunner on device [my device ID here] [2011-03-16 17:02:55 - AppName] Collecting test information [2011-03-16 17:02:55 - AppName] Test run failed: Process crashed. [2011-03-16 17:02:55 - AppName] Test run finished [2011-03-16 17:02:56 - AppName] Sending test information to Eclipse [2011-03-16 17:02:56 - AppName] Running tests... 

Any ideas?

+4
source share
2 answers

It should look like this:

 [2011-03-15 22:46:12 - TemperatureConverterTest] Collecting test information [2011-03-15 22:46:13 - TemperatureConverterTest] Sending test information to Eclipse [2011-03-15 22:46:13 - TemperatureConverterTest] Running tests... **[2011-03-15 22:46:14 - TemperatureConverterTest] Attempting to connect debugger to 'com.example.aatg.tc' on port 8654** [2011-03-15 22:46:31 - TemperatureConverterTest] Test run finished 

Please note that your test fails even before connecting the debugger. There may be a problem in the constructor.

+2
source

Make sure that the application under test has defined the android: debuggable = "true".

If your application does not debug, running tests in debug mode does not work. For instance. you don’t hit breakpoints and you get an error message in the log as above.

+1
source

Source: https://habr.com/ru/post/1343966/


All Articles