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