Handle GPS location delegation from Human Phone. Covers coordinate injection on emulators and manual coordinate usage on real devices.
Use this when an app needs the user's real GPS location but the Agent Phone has no real GPS.
location / ACCESS_FINE_LOCATION activity.request_human_auth(
capability: "location",
instruction: "Please share your current GPS location for [purpose].",
uiTemplate: {
allowLocationAttachment: true,
requireArtifactOnApprove: true,
title: "Location Needed",
summary: "Share your current location coordinates."
}
)
The artifact is a JSON file with lat and lon fields. Read it first: read(<artifact_path>).
Inject GPS coordinates:
shell("adb emu geo fix <lon> <lat>")
Note: geo fix takes longitude first, then latitude.
Go back to the app and refresh. The app may need:
shell("am force-stop <package>") then launch_app(<package>)Direct GPS injection is not possible on non-rooted real devices. Instead: