Android device CTS test is hard. Developing Android device test takes a long time. Here are some tools and instructions to accelerate Android device test development and debug.
Android Studio allows debuging an APK without the building. Before you start, make sure you have Setup CTS to run.
Open Android Studio, File> Profile or debug APK. Pick an APK form the testcases folder, and let Android Studio do it's work. After that is done, go to the activity that you want to debug and click on the atatch java/kolin source
After that is done, you should be able to set a breakpoint and debug the Java code like such.
It is easier to develope and debug with Android Studio. CTS is open source, it is possible to do so. However, CTS uses a different build system. You can create Android Studio Build configuration file to develope and debug the test module.
Examples:
Here is what it looks like after it's built
Here are links to downloading source files in this project. The following are all CTS 9.0_R11
To download, click tgz and unzip to your workspace
The following is a visualisation of a project
Master
If one just clones the release files, they could end up with a different tag, leading to more problems. Hence the need to specify CTS 9.0_R11