LinuxCommandLibrary

idevicesetlocation

Set iOS device location for testing

TLDR

Set a specific latitude and longitude

$ idevicesetlocation [latitude] [longitude]
copy

Reset the simulated location
$ idevicesetlocation reset
copy

SYNOPSIS

idevicesetlocation [-u UDID] [-d] [--gps-debug] LATITUDE LONGITUDE [ALTITUDE]

PARAMETERS

-u, --udid UDID
    Target specific device by its 40-character UDID (use idevice_id -l to list)

-d, --debug
    Enable detailed communication debugging output

-h, --help
    Print usage information and exit

-V, --version
    Print version information and exit

--gps-debug
    Enable GPS service debugging on the device

DESCRIPTION

The idevicesetlocation command is a tool from the libimobiledevice suite, designed to simulate GPS location data on connected iOS devices (iPhone, iPad, etc.) via USB. It communicates with the device's locationd service to override the real GPS coordinates with user-specified latitude, longitude, and optional altitude values.

This is useful for developers testing location-based apps, such as maps, ride-sharing, or geofencing features, without needing physical movement. The device must be unlocked, trusted (via 'Trust This Computer' prompt), and have Location Services enabled. It works on non-jailbroken devices running iOS 3.0+, but may require pairing first (use idevicepair if needed).

Specify coordinates in decimal degrees (e.g., 37.7749 -122.4194 for San Francisco). Altitude is in meters and optional. Changes take effect immediately and persist until reset or device restart. Debug mode helps troubleshoot connection issues. Requires libimobiledevice and usbmuxd installed on Linux.

CAVEATS

Requires USB connection and device trust; may not work if location services are off or VPN interferes; altitude support varies by iOS version; resets on device sleep/reboot.

EXAMPLE USAGE

idevicesetlocation 40.7128 -74.0060 10
Sets New York City location at 10m altitude.

idevicesetlocation -u 00008020-00123456789ABCDE -d 51.5074 -0.1278
Targets specific device with debug.

INSTALLATION

On Ubuntu/Debian: sudo apt install libimobiledevice-utils
Or build from source: https://libimobiledevice.org

HISTORY

Part of libimobiledevice project (started 2007 by Nikias Bassen); idevicesetlocation added in early versions (~2010) to support iOS 4+ location simulation; actively maintained for modern iOS.

SEE ALSO

ideviceinfo(1), idevice_id(1), idevicepair(1), libimobiledevice(3)

Copied to clipboard