Learn to automate Android applications with AskUI’s AndroidVisionAgent
Verify Device Connection
Create Your Android Agent Script
android_automation.py
and add the following code. This script will open the Android Settings app, navigate to the network settings, and then return to the home screen.reports
folder.Understanding AndroidVisionAgent
with
statement ensures that the connection to the device is automatically managed (connected on entry, disconnected on exit)shell()
method is a powerful tool for executing any ADB shell command. This is the primary way to manage applications, such as starting them with am start
or stopping them with am force-stop
tap()
is the method for performing touch clicks on the screen. It can take a text description, a locator, or coordinateskey_tap()
simulates pressing hardware or special keys. It accepts any key from the ANDROID_KEY
literal type, including BACK
, HOME
, VOLUME_UP
, and ENTER
adb devices
command.
agent.shell()
:
Device not detected
adb kill-server
and then adb start-server
in your terminal.adb devices
.App won't launch
com.android.settings
) is correct.Elements not found
agent.wait()
calls to give the UI time to load or animate.agent.swipe()
to scroll it into view."button"
, try "blue login button"
.