AppFunctions Testing Agent is a testing and debugging tool for Android AppFunctions. It allows developers to troubleshoot integration issues, manually invoke functions with deterministic input, and test functions using an LLM-based agent.
- ADB: Ensure you have
adbinstalled and in your PATH. - Device/Emulator: A connected Android device or emulator with developer options enabled.
To build, install, and launch the app with elevated privileges (required for some AppFunctions APIs),
use the run_privileged.sh script.
./run_privileged.sh [OPTIONS]-b, --build: Force a rebuild of the app before installing.-r, --release: Use the release build type instead of debug.-f, --flavor FLAVOR: Specify the build flavor (standardorretail). Defaults tostandard.-k, --api-key KEY: The Gemini API key (required forretailbuilds if not set elsewhere).-h, --help: Show the help message.
Standard Debug Build
./run_privileged.sh --buildRetail Debug Build with API Key
./run_privileged.sh --build --flavor retail --api-key YOUR_API_KEYAlways run relevant tests to verify your changes before committing.
Run unit tests for all variants:
./gradlew testOr for a specific variant:
./gradlew testStandardDebugUnitTest
./gradlew testRetailDebugUnitTest -PGEMINI_API_KEY=YOUR_API_KEYRun instrumented tests on a connected device:
./gradlew connectedAndroidTestNote: Some instrumented tests require a Gemini API key.
Pass it using -Pandroid.testInstrumentationRunnerArguments.gemini_api_key=YOUR_API_KEY.
Verify UI changes with screenshot tests:
./gradlew updateDebugScreenshotTestTo create a distributable test suite bundle, use the bundle.sh script.
This script creates a zip file containing the APK, instructions, and a launch script.
./bundle.sh [OPTIONS]-o, --output-dir DIR: Directory to save the bundle (default: current directory).-r, --release: Build the release version instead of debug.-f, --flavor FLAVOR: Specify the build flavor (standardorretail). Defaults tostandard.-k, --api-key KEY: The Gemini API key (required forretailbuilds).
Bundle Standard Debug Version
./bundle.shBundle Retail Debug Version
./bundle.sh --flavor retail --api-key YOUR_API_KEY