|
3 | 3 |
|
4 | 4 | ## Prereqs
|
5 | 5 |
|
6 |
| -- Ensure `dotnet` is installed and available with the `dotnet` command for easy xharness installation. Any supported .NET Core version should work. [Dotnet Download](https://dotnet.microsoft.com/en-us/download) or [Daily Dotnet Download](https://github.com/dotnet/sdk/blob/main/documentation/package-table.md) |
| 6 | +- Ensure `python` is installed and available. Any currently supported `python` 3.* version should work. Downloads are available at https://www.python.org/downloads/. |
| 7 | +- Ensure `dotnet` is installed and available with the `dotnet` command for easy xharness installation. Any supported .NET Core version should work. [Dotnet Download](https://dotnet.microsoft.com/en-us/download) or [Daily Dotnet Download](https://github.com/dotnet/sdk/blob/main/documentation/package-table.md). |
7 | 8 | - Ensure `xharness` is installed and available with the `xharness` command. The current version in use can be found in the `eng/performance/maui_scenarios_android.proj` file at line 7 (under the tag `MicrosoftDotNetXHarnessCLIVersion`), although any recent version should work. [XHarness Install Instructions](https://github.com/dotnet/xharness?tab=readme-ov-file#installation-and-usage).
|
8 | 9 | - Have an Android app APK available for testing.
|
9 | 10 | - Have an Android Device (with developer mode enabled) or emulator connected to computer, and viewable with `xharness android device` or `xharness android adb -- devices -l`.
|
|
14 | 15 |
|
15 | 16 | ```sh
|
16 | 17 | cd src/scenarios
|
17 |
| - . ./init.sh # or `.\init.ps1` on Windows |
| 18 | + . ./init.sh # or `.\init.ps1` on Windows. Can specify custom dotnet install with -dotnetdir <dir>, but dotnet install should not impact Android Startup testing itself. |
18 | 19 | ```
|
19 | 20 |
|
20 | 21 | 2. Navigate to the `helloandroid` scenario directory:
|
|
27 | 28 | 4. Run the test:
|
28 | 29 |
|
29 | 30 | ```sh
|
30 |
| - python test.py devicestartup --device-type android --package-path <path to apk (e.g. .)>/<apkname>.apk --package-name <apk package name> [--disable-animations] |
| 31 | + python/(py -3 on Linux) test.py devicestartup --device-type android --package-path <path to apk (e.g. .)>/<apkname>.apk --package-name <apk package name> [--disable-animations] [--use-fully-drawn-time --fully-drawn-extra-delay <delay in sec> (**see below for note**)] |
31 | 32 | ```
|
32 | 33 |
|
| 34 | +5. Read the output: |
| 35 | + |
| 36 | + During the running of the test you will see the loop of the activity being started to get the startup times. |
| 37 | + Once the testing is completed, you will see output similar to the following: |
| 38 | + |
| 39 | + ```txt |
| 40 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 713 |
| 41 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 715 |
| 42 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 728 |
| 43 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 716 |
| 44 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 715 |
| 45 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 734 |
| 46 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 716 |
| 47 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 718 |
| 48 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 713 |
| 49 | + [2025/01/29 11:15:44][INFO] Found Value (ms): 706 |
| 50 | + [2025/01/29 11:15:44][INFO] Device Startup - Maui Android Default NoAnimation |
| 51 | + [2025/01/29 11:15:44][INFO] Metric |Average |Min |Max |
| 52 | + [2025/01/29 11:15:44][INFO] ----------------|---------------|---------------|--------------- |
| 53 | + [2025/01/29 11:15:44][INFO] Generic Startup |717.400 ms |706.000 ms |734.000 ms |
| 54 | + ``` |
| 55 | + |
| 56 | + The Found Value's are the individual test run startup times with the overall stats at the bottom. The stats provided include the following startup stats: average, minimum, and maximum times. |
| 57 | +
|
33 | 58 | ## Notes
|
34 | 59 |
|
35 |
| -- Example commands and additional logic can be found in the `maui_scenarios_android.proj` and `runner.py` files in the `performance` repository. |
| 60 | +- Specific example command such as when using the runtime android example app: `python test.py devicestartup --device-type android --package-path HelloAndroid.apk --package-name net.dot.HelloAndroid`. |
| 61 | +- Other example commands and additional logic can be found in the `maui_scenarios_android.proj` and `runner.py` files in the `performance` repository. |
| 62 | +- If using `[--use-fully-drawn-time --fully-drawn-extra-delay <delay in sec>]` arguments, the Android app must have reportFullyDrawn() called on a ComponentActivity. Reference: https://developer.android.com/topic/performance/vitals/launch-time#retrieve-TTFD. |
0 commit comments