1 # VTS User Manual 2 3 Linux is officially supported for building and running VTS. Building on Windows is not supported, but it is possible to [run VTS on Windows](#run_vts) with Python, Java, and ADB installed. 4 5 The following instructions assume Linux environment. 6 7 ## 1. Setup 8 9 ### 1.1. Host setup 10 11 * [Setup Manual](setup/index.md) 12 13 ### 1.2. Checkout master git repository 14 15 [Download Android Source Code](https://source.android.com/source/downloading.html) 16 17 `$ export branch=master` 18 19 `$ mkdir ${branch}` 20 21 `$ cd ${branch}` 22 23 `$ repo init -b ${branch} -u persistent https://android.googlesource.com/platform/manifest` 24 25 `$ repo sync -j 8` 26 27 ### 1.3. Build an Android image 28 29 `$ cd ${branch}` 30 31 `$ . build/make/envsetup.sh` 32 33 `$ lunch aosp_arm64-userdebug # or <your device>-userdebug` 34 35 The below is an optional step: 36 37 `$ make -j 8` 38 39 If this fails, please do: 40 41 `$ repo sync -j 8` 42 43 `$ make -j 8` 44 45 Such can happen because tip of tree (ToT) may not always be buildable. 46 47 ### 1.4. Build a VTS package 48 49 `$ cd ${branch}` 50 51 `$ make vts -j8` 52 53 Or use the exact command: 54 55 `$ make -j8 vts showcommands dist TARGET_PRODUCT=aosp_arm64 WITH_DEXPREOPT=false TARGET_BUILD_VARIANT=userdebug` 56 57 ### 1.5. Connect to an Android device 58 59 Let's connect an Android device and a host computer using a USB cable. 60 61 * On an Android device, Setting -> About Phone -> Click repeatedly 'Build number' until developer mode is enabled. 62 * On an Android device, Setting -> Developer options -> Turn on 'USB debugging' 63 * On a host, run `adb devices` from a command line shell. 64 * On a Android device, confirm that the host is trusted. 65 * On a host, type `adb shell` and if that works, we're ready. 66 67 ## 2. Run VTS Tests 68 69 ### <a name="run_vts" /> 2.1. Run a VTS test plan 70 71 For Linux users, 72 73 `$ vts-tradefed` 74 75 `> run vts` 76 77 For Windows users, please build on Linux. Then copy the following zip file to Windows and extract it. 78 79 `out/host/linux-x86/vts/android-vts.zip` 80 81 Launch the batch file in the extracted folder. 82 83 `$ android-vts\tools\vts-tradefed_win.bat` 84 85 `> run vts` 86 87 Example stdout: 88 89 ``` 90 91 92 08-16 09:36:03 I/ResultReporter: Saved logs for device_logcat in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/device_logcat_7912321856562095748.zip 93 08-16 09:36:03 I/ResultReporter: Saved logs for host_log in .../out/host/linux-x86/vts/android-vts/logs/2016.08.16_09.17.13/host_log_2775945280523850018.zip 94 08-16 09:36:04 I/ResultReporter: Invocation finished in 18m 50s. PASSED: 18, FAILED: 0, NOT EXECUTED: 2, MODULES: 8 of 10 95 08-16 09:36:04 I/ResultReporter: Test Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13/test_result.xml 96 08-16 09:36:04 I/ResultReporter: Full Result: .../out/host/linux-x86/vts/android-vts/results/2016.08.16_09.17.13.zip 97 ``` 98 99 ### 2.2. Test report for APFE (Android Partner Front-End) 100 101 The uploadable report xml file can be found at 102 103 `out/host/linux-x86/vts/android-vts/results/` 104 105 After Android O release, you will be able to upload that xml file to [AFPE](https://partner.android.com) 106 and obtain a certificate. 107 108 ### 2.3. Check the test logs 109 110 `$ vi out/host/linux-x86/vts/android-vts/logs/` 111 112 Then select a directory which captures the time stamp of your test run (e.g., 2016.08.16_09.17.13). 113 114 Then select `host_log_<timestamp>.zip` and host_log.txt in that zip file for host log. 115 116 Then select `device_logcat_<timestamp>.zip` and device_logcat.txt in that zip file for device log. 117 118 ## 3. Run Options for Advanced Users 119 120 ### 3.1. List of VTS Plans 121 122 Documented at [here](../tools/vts-tradefed/res/config/plans.md). 123 124 ### 3.2. Run kernel test cases 125 126 LTP (Linux Test Project) is part of vts-kernel. 127 [This doc](developer_testing/kernel/ltp.md) shows how to run each LTP test case. 128 129 ## 4. Debugging 130 131 ### 4.1. Run VTS tests directly for debugging 132 133 [Run directly from command line](testcase_develop_manual/run_vts_directly.md) 134