• Home
Name Date Size #Lines LOC

..--

gradle/wrapper/04-Jul-2025-76

src/04-Jul-2025-4,9113,578

.gitignoreD04-Jul-2025110 1110

Android.bpD04-Jul-20251.3 KiB4945

CONTRIBUTING.mdD04-Jul-20251 KiB2618

LICENSED04-Jul-202511.1 KiB203169

METADATAD04-Jul-2025796 2119

MODULE_LICENSE_APACHE2D04-Jul-20250

OWNERSD04-Jul-2025274 1210

README.mdD04-Jul-20252.2 KiB7048

build.gradleD04-Jul-20253 KiB11397

gradle.propertiesD04-Jul-2025115 54

gradlewD04-Jul-20254.9 KiB161120

README.md

1Mobly Bundled Snippets is a set of Snippets to allow Mobly tests to control
2Android devices by exposing a simplified version of the public Android API
3suitable for testing.
4
5We are adding more APIs as we go. If you have specific needs for certain groups
6of APIs, feel free to file a request in [Issues](https://github.com/google/mobly-bundled-snippets/issues).
7
8Note: this is not an official Google product.
9
10
11## Usage
12
131.  Compile and install the bundled snippets
14
15        ./gradlew assembleDebug
16        adb install -d -r -g ./build/outputs/apk/debug/mobly-bundled-snippets-debug.apk
17
181.  Use the Mobly snippet shell to interact with the bundled snippets
19
20        snippet_shell.py com.google.android.mobly.snippet.bundled
21        >>> print(s.help())
22        Known methods:
23          bluetoothDisable() returns void  // Disable bluetooth with a 30s timeout.
24        ...
25          wifiDisable() returns void  // Turns off Wi-Fi with a 30s timeout.
26          wifiEnable() returns void  // Turns on Wi-Fi with a 30s timeout.
27        ...
28
291.  To use these snippets within Mobly tests, load it on your AndroidDevice objects
30    after registering android_device module:
31
32    ```python
33    def setup_class(self):
34      self.ad = self.register_controllers(android_device, min_number=1)[0]
35      self.ad.load_snippet('api', 'com.google.android.mobly.snippet.bundled')
36
37    def test_enable_wifi(self):
38      self.ad.api.wifiEnable()
39    ```
40
41## Develop
42
43If you want to contribute, use the usual github method of forking and sending
44a pull request.
45
46Before sending a pull request, run the `presubmit` target to format and run
47lint over the code. Fix any issues it indicates. When complete, send the pull
48request.
49
50```shell
51./gradlew presubmit
52```
53
54This target will reformat the code with
55[googleJavaFormat](https://github.com/sherter/google-java-format-gradle-plugin)
56and run lint. The lint report should open in your default browser.
57
58Be sure to address *all* off the errors reported by lint. When finished and you
59run `presubmit` one last time you should see:
60
61> No Issues Found
62>   Congratulations!
63
64in your browser.
65
66## Other resources
67
68  * [Mobly multi-device test framework](http://github.com/google/mobly)
69  * [Mobly Snippet Lib](http://github.com/google/mobly-snippet-lib)
70