1## 6.1\. Developer Tools
2
3Device implementations:
4
5*   [C-0-1] MUST support the Android Developer Tools provided in the Android
6SDK.
7*   [**Android Debug Bridge (adb)**](http://developer.android.com/tools/help/adb.html)
8    *   [C-0-2] MUST support adb as documented in the Android SDK and the shell
9        commands provided in the AOSP, which can be used by app developers,
10        including [`dumpsys`](https://source.android.com/devices/input/diagnostics.html)
11        `cmd stats`
12    *   [C-SR] Are STRONGLY RECOMMENDED to support the shell command
13    `cmd testharness`.
14    *   [C-0-3] MUST NOT alter the format or the contents of device system
15        events (batterystats , diskstats, fingerprint, graphicsstats, netstats,
16        notification, procstats) logged via the dumpsys command.
17    *   [C-0-10] MUST record, without omission, and make the following events
18        accessible and available to the `cmd stats` shell command and the
19        `StatsManager` System API class.
20        *   ActivityForegroundStateChanged
21        *   AnomalyDetected
22        *   AppBreadcrumbReported
23        *   AppCrashOccurred
24        *   AppStartOccurred
25        *   BatteryLevelChanged
26        *   BatterySaverModeStateChanged
27        *   BleScanResultReceived
28        *   BleScanStateChanged
29        *   ChargingStateChanged
30        *   DeviceIdleModeStateChanged
31        *   ForegroundServiceStateChanged
32        *   GpsScanStateChanged
33        *   JobStateChanged
34        *   PluggedStateChanged
35        *   ScheduledJobStateChanged
36        *   ScreenStateChanged
37        *   SyncStateChanged
38        *   SystemElapsedRealtime
39        *   UidProcessStateChanged
40        *   WakelockStateChanged
41        *   WakeupAlarmOccurred
42        *   WifiLockStateChanged
43        *   WifiMulticastLockStateChanged
44        *   WifiScanStateChanged
45    *   [C-0-4] MUST have the device-side adb daemon be inactive by default and
46    there MUST be a user-accessible mechanism to turn on the Android Debug
47    Bridge.
48    *   [C-0-5] MUST support secure adb. Android includes support for secure
49    adb. Secure adb enables adb on known authenticated hosts.
50    *   [C-0-6] MUST provide a mechanism allowing adb to be connected from a
51    host machine. For example:
52
53        *   Device implementations without a USB port supporting peripheral mode
54        MUST implement adb via local-area network (such as Ethernet or Wi-Fi).
55        *   MUST provide drivers for Windows 7, 9 and 10, allowing developers to
56        connect to the device using the adb protocol.
57
58*    [**Dalvik Debug Monitor Service (ddms)**](http://developer.android.com/tools/debugging/ddms.html)
59    *   [C-0-7] MUST support all ddms features as documented in the Android SDK.
60    As ddms uses adb, support for ddms SHOULD be inactive by default, but
61    MUST be supported whenever the user has activated the Android Debug Bridge,
62    as above.
63*    [**Monkey**](http://developer.android.com/tools/help/monkey.html)
64    *   [C-0-8] MUST include the Monkey framework and make it available for
65    applications to use.
66*    [**SysTrace**](http://developer.android.com/tools/help/systrace.html)
67    *   [C-0-9] MUST support the systrace tool as documented in the Android SDK.
68    Systrace must be inactive by default and there MUST be a user-accessible
69    mechanism to turn on Systrace.
70*    [**Perfetto**](https://developer.android.com/studio/command-line/perfetto)
71    *   [C-SR] Are STRONGLY RECOMMENDED to expose a `/system/bin/perfetto`
72        binary to the shell user which cmdline complies with
73        [the perfetto documentation](
74        https://developer.android.com/studio/command-line/perfetto).
75    *   [C-SR] The perfetto binary is STRONGLY RECOMMENDED to accept as input a
76        protobuf config that complies with the schema defined in
77        [the perfetto documentation](
78        https://developer.android.com/studio/command-line/perfetto).
79    *   [C-SR] The perfetto binary is STRONGLY RECOMMENDED to write as output a
80        protobuf trace that complies with the schema defined in
81        [the perfetto documentation](
82        https://developer.android.com/studio/command-line/perfetto).
83    *   [C-SR] Are STRONGLY RECOMMENDED to provide, through the perfetto binary,
84        at least the data sources described  in [the perfetto documentation](
85        https://developer.android.com/studio/command-line/perfetto).
86
87*    [**Test Harness Mode**](https://source.android.com/compatibility/cts/harness)
88
89    If device implementations support the shell command `cmd testharness` and
90    run `cmd testharness enable`, they:
91
92    *   [C-2-1] MUST return `true` for
93        `ActivityManager.isRunningInUserTestHarness()`
94    *   [C-2-2] MUST implement Test Harness Mode as described in [harness mode documentation](
95        https://source.android.com/compatibility/cts/harness).
96
97If device implementations report the support of Vulkan 1.0 or higher via the
98`android.hardware.vulkan.version` feature flags, they:
99
100*   [C-1-1] MUST provide an affordance for the app developer to enable/disable
101    GPU debug layers.
102*   [C-1-2] MUST, when the GPU debug layers are enabled, enumerate layers in
103    libraries provided by external tools (i.e. not part of the platform or
104    application package) found in debuggable applications' base directory to
105    support [vkEnumerateInstanceLayerProperties()](
106    https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumerateInstanceLayerProperties.html)
107    and [vkCreateInstance()](
108    https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCreateInstance.html)
109    API methods.
110