Lybic Docs

Setting Android Sandbox GPS Location

The Android sandbox supports mocking GPS location. You can set the GPS coordinates by running a command:

Set the latitude and longitude:

settings put global gps_inject_info 22.616273,114.024649

Here 22.616273 is the latitude and 114.024649 is the longitude. You can replace them with any coordinates you need.

If you are using the Python SDK, you can set the GPS location with the following code (requires SDK version >= 1.1.0):

import asyncio
from Lybic import LybicClient, LybicAuth

async def main():
    async with LybicClient(
        LybicAuth(
            org_id="ORG-xxxx",
            api_key="lysk-xxxxxxxxxxx",
            endpoint="https://api.Lybic.cn/"
        )
    ) as client:
        result = await client.tools.mobile_use.set_gps_location(
            'sandbox_id', 22.616273, 114.024649
        )
        print("GPS location set successfully:", result)

if __name__ == "__main__":
    asyncio.run(main())