Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Mobly test framework
Stay organized with collections
Save and categorize content based on your preferences.
Mobly is an open-source test framework for
host-driven, end-to-end automated testing. You can use Mobly to orchestrate
actions across multiple devices to validate Android features including Wi-Fi and
telephony.
Mobly basics
Using Mobly, you can write and execute Mobly tests to verify Android features.
To learn the basics of using Mobly, see the
Mobly tutorial.
You can also use the
Mobly Snippet Lib
to build custom test APKs for triggering device-side code from the host.
Mobly features
The Mobly test framework provides the following features:
Flexible test organization
Mobly is a standalone library, on which users can build different test
suites. Mobly users are isolated from other users' changes.
Users can add dependencies to project-specific test suites without
impacting other users.
Mobly snippets lets users create custom test APKs with only the APIs
relevant to the test. This minimizes the file size overhead of test
APKs.
Simple to maintain and debug
Mobly provides informative test results including test and snippet
stacktraces, and per-test-iteration results for repeated or retried
tests.
The Mobly codebase is covered by presubmit unit tests, and enforces unit
test coverage for new code contributions, which reduces the risk of code
errors.
Mobly snippet APKs can run without privileged access, which allows testing
on a large number of platforms.
Example Mobly tests
The following are examples of Mobly tests for Android features:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-26 UTC."],[],[],null,["# Mobly test framework\n\n[Mobly](https://github.com/google/mobly/) is an open-source test framework for\nhost-driven, end-to-end automated testing. You can use Mobly to orchestrate\nactions across multiple devices to validate Android features including Wi-Fi and\ntelephony.\n\nMobly basics\n------------\n\nUsing Mobly, you can write and execute Mobly tests to verify Android features.\nTo learn the basics of using Mobly, see the\n[Mobly tutorial](https://github.com/google/mobly/blob/master/docs/tutorial.md).\n\nYou can also use the\n[Mobly Snippet Lib](https://github.com/google/mobly-snippet-lib)\nto build custom test APKs for triggering device-side code from the host.\n\nMobly features\n--------------\n\nThe Mobly test framework provides the following features:\n\n- Flexible test organization\n\n - Mobly is a standalone library, on which users can build different test\n suites. Mobly users are isolated from other users' changes.\n\n - Users can add dependencies to project-specific test suites without\n impacting other users.\n\n - Mobly snippets lets users create custom test APKs with only the APIs\n relevant to the test. This minimizes the file size overhead of test\n APKs.\n\n- Simple to maintain and debug\n\n - Mobly provides informative test results including test and snippet\n stacktraces, and per-test-iteration results for repeated or retried\n tests.\n\n - The Mobly codebase is covered by presubmit unit tests, and enforces unit\n test coverage for new code contributions, which reduces the risk of code\n errors.\n\n- Mobly snippet APKs can run without privileged access, which allows testing\n on a large number of platforms.\n\nExample Mobly tests\n-------------------\n\nThe following are examples of Mobly tests for Android features:\n\n- Test for [Wi-Fi Direct](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/tests/hostsidetests/multidevices/test/direct/wifi_direct_test.py)\n- Test for [CompanionDeviceManager](https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/tests/CompanionDeviceMultiDeviceTests/host/cdm_transport_test.py)"]]