The previous article described how to build CTS in Windows and run CTS for testing. This article is about how to configure the source code in Eclipse for debug debugging.
Download
CTS Source Address: https://android.googlesource.com/platform/cts
You can use git to download it locally.
directory Structure
There is a project under the Tools folder: Tradefed-host
Put this project into eclipse.
The exclamation point occurs because of a problem with the jar package reference.
So we're going to refer to the local jar package. Search the following jar on the Internet, I have also uploaded my local.
Ddmlib-prebuilt.jar,tradefed-prebuilt.jar,hosttestlib.jar,javalib-deviceinfo.jar,javalib-deviceutil.jar
After importing, the exclamation point disappears.
For Deviceinforesult.java's error
Delete it or change it to deviceinfoconstants.open_gl_es_version, without affecting it.
Source Run
Find the entry class for the project Ctsconsole.java, right-click
Click Debug Configurations ... to find the Java application, select the parameter Arguments column.
The configuration is as follows:
Program arguments is configured to represent you in the previous CTS command line under the input run CTS--plan signature is a meaning.
This time we chose signature this plan, the last article with Java Plan waited 3 hours to execute. This time for a simple one.
This time right-click Ctsconsole.java run. The console will appear as follows:
As shown on the command line, the difference is that we are running with the source code.
Debug
Above already can use the source code to run, below starts to debug the source code using debug mode.
Make a breakpoint on the main method of the Ctsconsole.java.
Right-click Debug mode to start.
Click Yes to enter debug mode.
At this point we have started debug debugging. The following article is a step-by-step approach to understanding the mechanism of the CTS framework with the debug mode.