Skip to content

About

A small project that spoofs GPS location data on iOS devices

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Imagine Me Here Please

A small project that just spoofs GPS location data on connected iPhones (maybe even iPads). I thought asking my phone nicely might get it to play ball a bit better.

Screenshot of the app running on MacOS displaying the Point Spoof operation to show your phone inside Buckingham Palace connecting to the phone over Wi-Fi.

imhp is basically a Rust CLI and desktop 'app' for testing location-aware apps on real iOS 17+ devices. It can hold a fixed point, plan a route on a map and play it back at a given speed, or wander somewhat randomly according to user-defined constraints; over USB or Wi-Fi. There's no jailbreak, Xcode isn't required, and nothing is installed on the phone. It just needs your phone to be in Developer mode, which this can also help you do by showing the option for you on your phone. Just search in this readme for reveal and you'll find some directions on how to do that stuff.

Warning

The desktop apps on the Releases page are unsigned.

I ain't made of money, so your OS will probably complain the first time you open it in one of these ways:

  • macOS: if it says the app "is damaged and can't be opened" or "cannot be verified", drag it into Applications and run xattr -dr com.apple.quarantine "/Applications/Imagine Me Here Please.app", or open it once and then go to System Settings -> Privacy & Security -> Open Anyway.
  • Windows: SmartScreen will say "Windows protected your PC": click More info -> Run anyway.
  • Linux: make the AppImage executable with chmod +x Imagine*.AppImage, or install the .deb.
  • Immutable Linux (like Bazzite)?:

If that makes you uneasy, build it yourself from source (see Desktop app).

And it should make you uneasy. It's a very swiftly growing epidemic with the advent of AI-coded stuff that people are growing lax on checking what they download and run.

You might have found this while looking for GPS Spoofing tools to cheat on Walking Games with, you're probably at risk of downloading malware in that case. Please be safe.

And further to using this to cheat in a game, I suggest never 'teleporting' where the game is concerned (travelling an insurmountable distance within a tiny length of time). Set it to running speed and make do. Or turn off background GPS, turn off the game, set your GPS, then give it 8 or so hours before turning the game back on.

This is also not to mention that any Walking Game with it's salt is going to check isSimulatedBySoftware anyway, which this, by being software that simulates a geolocation flags as true. If you want to circumnavigate that, you're going to need a jailbroken phone, and that's not what this does.

Quick start

(This assumes the iPhone is in Developer mode, if it isn't then read One-time phone setup first)

cp .env.example .env               # optional: add your MapTiler key (see "Map tiles" below)
cargo install --path crates/cli    # installs `imhp`
imhp ddi fetch                     # one-time: download the developer disk image (skip if you already have the iOS image or Xcode is installed)
imhp devices                       # list phones on USB / Wi-Fi
imhp set 51.5014, -0.1419          # cli-interaction, this just holds the given location until Ctrl-C is pressed
imhp serve                         # open the map UI in your browser

Desktop app

The same map UI as a native app (Tauri), with no local web server:

cargo run -p imhp-desktop                         # run it
cargo install tauri-cli --version 2.12.5 --locked # once, for packaging
cd crates/desktop && cargo tauri build            # .app/.dmg, .msi/.exe, .AppImage/.deb

macOS DMG fails with Finder got an error: AppleEvent timed out (-1712)? The DMG step uses AppleScript to arrange the window in Finder, and your terminal (or VS Code) isn't allowed to control Finder. Either allow it under System Settings -> Privacy & Security -> Automation -> your terminal -> Finder, or skip the arrangement with CI=true cargo tauri build. That produces the same app in a plain DMG. The hdiutil ... is deprecated lines are harmless warnings.

Compared with imhp serve:

  • No network port. The window loads imhp://localhost/, and the app answers those requests in-process, so there's no token to copy.
  • Native Save dialog for Export GPX.
  • Tray menu with Show, Pause all, Resume all, Stop spoofing and Quit. Closing the window while a phone is being spoofed keeps it running in the tray.
  • Quitting always restores real GPS.

On Linux you'll need webview libraries like: libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev. Builds are unsigned, so see the warning at the top for getting past Gatekeeper or SmartScreen.

Immutable Linux

We can just install packages on host, but that's not suggested, so here's a distrobox alternative. But you do you, if you or your Agent knows better.

cp .env.example .env               # optional: add your MapTiler key (see "Map tiles" below)
imhp ddi fetch                     # one-time: download the developer disk image (skip if you already have the iOS image)
cargo install --path crates/cli    # installs `imhp` and will probably fail
cargo run -p imhp-desktop          # run it and it will probably fail
distrobox create --name tauri-dev --image registry.fedoraproject.org/fedora:45  # We're special, so we need to containerise it
distrobox enter tauri-dev                                                       # Go into the container we just made
# Copy and paste this entire block into the box and run it as one:
sudo dnf install -y gcc webkit2gtk4.1-devel openssl-devel dbus-devel \
  libappindicator-gtk3-devel librsvg2-devel libxdo-devel pkgconf-pkg-config
cd "/var/home/conor/Documents/Development/Web/Imagine Me Here Please"
cargo run -p imhp-desktop

That should then pop up the app in the distrobox. To get back out of it in your terminal once you've finished using the app, type exit or just close the terminal.

To get back into it at any time type distrobox enter tauri-dev and then run cargo run -p imhp-desktop in there.

Map tiles

Map tiles are fetched by imhp itself and handed to the page, so API keys never reach the browser or webview. With a MapTiler key it uses MapTiler; without one it falls back to OpenStreetMap.

  1. cp .env.example .env. .env is git-ignored, so it never goes to the remote.
  2. Fill in IMHP_MAPTILER_KEY and IMHP_MAPTILER_USER_AGENT. The User-Agent must match any restriction set on the key. Optionally set IMHP_MAPTILER_MAP, e.g. outdoor-v2.
  3. Rebuild. The values are baked into the binary at build time. The same variables set when running override them, and CI can supply them as secrets.

A key built into an app you hand to friends can be extracted from it. MapTiler's User-Agent restriction is a deterrent, not a lock, so use a key just for this, watch its usage, and rotate it if it leaks.

One-time phone setup

  1. Connect the phone over USB, unlock it, and tap Trust This Computer.
  2. Turn on Developer Mode. If the phone has never been connected to Xcode (the other way of revealing the dev toggle on your device), the switch is hidden. So you can run imhp devmode reveal, first. Then go to Settings -> Privacy & Security -> Developer Mode -> On. The phone restarts; confirm when it comes back. Check it with imhp devmode status.
    • In the app or imhp serve, the device panel checks this for you. If Developer Mode is off it shows the steps, a Reveal Developer Mode setting button and Check again. imhp never turns Developer Mode on itself; you always do that on the phone.
  3. (For Wi-Fi) In Finder, select the phone and tick Show this iPhone when on Wi-Fi. After that the phone appears in imhp devices as wifi whenever it's on the same network. Wi-Fi needs iOS 17.4 or later.

The first time you spoof, imhp mounts Apple's personalised Developer Disk Image. This happens generally once per phone reboot and needs internet access to reach Apple's signing server.

Commands

Command What it does
imhp devices List connected devices, with transport, iOS version and name
imhp set <LAT> <LON> / imhp set <LAT,LON> / imhp set <preset> Spoof one location and hold it until Ctrl-C, then restore real GPS
imhp clear Restore real GPS
imhp route <trip.gpx | saved-name> --speed 1.4 [--repeat] [--interval 1] Move along a GPX file or saved route at the given speed in metres per second (m/s), sending a position every --interval seconds
imhp potter <LAT> <LON> | <preset> [--speed 1.4] [--turn-every 5] [--max-turn 40] [--interval 1] Wander aimlessly from a start point until Ctrl-C (see Potter about below)
imhp serve [--port N] Map UI on 127.0.0.1 (see below)
imhp preset add <name> <LAT> <LON> / list / remove / path Manage saved locations
imhp routes list / import <file> <name> / export <name> [-o file] / remove <name> Manage saved routes
imhp devmode status / reveal Check Developer Mode, or make its switch appear in Settings (you turn it on, on the phone)
imhp ddi fetch / status / mount Developer Disk Image helpers

Map UI (imhp serve)

  • Modes: Point ◦ Route ◦ Potter about. Pick a mode, set it up, then turn on Spoof location. Nothing reaches the phone until you do, and turning it off always restores real GPS.
  • Point. Clicking the map, entering coordinates or picking a preset only moves the pin. While spoofing is on, dragging or moving the pin updates the phone straight away.
  • Potter about. Wanders from the pin at the chosen speed so you can test tracking without setting anything up. Every 5s (adjustable) it picks a random turn of up to ±40° (adjustable) and eases into it over the interval. Repeated small turns walk a straight line, repeated full turns walk a circle, and most of the time it's somewhere in between. A dotted trail shows where it's been.
  • Live position. While a route or potter run is going, a marker with a direction arrow shows where the phone is. It glides smoothly between updates. A progress line shows the lap, the percentage done, elapsed and total time and the distance; for pottering it shows distance, time and heading.
  • Pause / Step.
    • Pause (or P) freezes a route or potter run where it is, and the phone holds that exact spot for as long as you like, so you can debug a problem area. The held coordinates are shown with a Copy button.
    • Step moves on by one update's worth of travel and holds again, so you can creep through a tricky section.
    • Resume carries on from the same spot. Paused time doesn't count towards elapsed time.
  • Update interval (default 1 s) sets how often a route or potter run sends the phone a new position; each update moves it speed × interval metres. 1s matches a real iPhone's GPS, so leave it there for realistic journeys. Lower it for smoother movement, or raise it to test how an app copes with sparse fixes, gaps and late geofence events.
    • ⚠️ At the extremes this stops being realistic. ⚠️
    • Below about 0.5s, apps may throttle or coalesce updates and you pay for it in traffic and battery. Long intervals, or high speeds, produce big jumps (31 m/s every 60s is about 1.9 km per update), which apps may treat as lost signal, discard, or flag as spoofed. The UI warns when you pick such values. On intervals over 2s the map marker jumps with the phone instead of gliding.
  • Plan route. Click to add waypoints, drag them to adjust and right-click to delete one. ⌘Z or Backspace undoes the last point. To finish, click the green first point to close the loop, or press Finish / Esc to leave the route open-ended. You can drag waypoints after finishing too.
  • Playing a route. In Route mode, turning spoofing on plays the route at the chosen speed in m/s. Presets are provided: Walk 1.4, Run 3, Cycle 5, City drive 13 and Motorway 31. A route that ends without repeating holds its last point until you switch off.
  • Repeat route when it finishes starts the route again each time it ends. A closed loop goes round continuously; an open route jumps from its last point back to its first.
  • On first open, the map centres on the phone's spoofed location if it has one. iOS doesn't let a computer read the phone's real GPS, so otherwise the map centres on the computer's location (your browser asks for permission), since the phone is normally nearby. If you decline, it reopens where you last left it.
  • Save / Import GPX / Export GPX. Routes are saved to your library so the CLI can use them too (imhp route <name>). Imported GPX tracks become editable. Tracks with more than 400 points are shown as a line only.

Spoof Types

Point

Screenshot of the app running on MacOS displaying the Point Spoof operation to show your phone inside Buckingham Palace connecting to the phone over Wi-Fi. My actual, true to life, real place of residence! :)

Screenshot of the app running on MacOS displaying the Point Spoof operation to show your phone inside Buckingham Palace connecting to the phone over Wi-Fi.

Route

Screenshot of the app being served on Chrome displaying the Route Spoof operation to show your phone walkinging around Queens Gardens connecting to the phone over Wi-Fi.

Screenshot of the app being served on Chrome displaying the Route Spoof operation to show your phone inside walkinging around Queens Gardens connecting to the phone over Wi-Fi.

Potter About

Screenshot of the app running on MacOS displaying the Potter About Spoof operation to show your phone walking randomly near Buckingham Palace connecting to the phone over Wi-Fi. I even added a little dotted line to see where you've had a potter. Can you walk on water? I apparently can. Or maybe it's like that boat bit in Pirates of the Carribean. That movie slaps tbf.

Screenshot of the app running on MacOS displaying the Potter About Spoof operation to show your phone walking randomly near Buckingham Palace connecting to the phone over Wi-Fi.

Global options

  • --udid <UDID>: choose a device. This is required if more than one is connected; imhp won't guess.

  • --via usb|wifi: only use one transport.

  • --host <IP> --pairing-file <FILE>: connect straight to a phone's IP without going through usbmuxd, e.g. across a VPN. On macOS, pairing records live in /var/db/lockdown/.

  • --ddi <DIR>: use a specific DDI folder. Both Xcode's layout and a flat layout work.

  • -v / -vv, or IMHP_LOG=debug: more logging.

  • --library <FILE> (or IMHP_LIBRARY): use a different library file.

Presets and routes live together in one TOML library. Run imhp preset path to see where; on macOS it's ~/Library/Application Support/imhp/library.toml. An older presets.toml in the same folder is still read.

[presets.buckingham-palace]
lat = 51.5014
lon = -0.1419

[routes.nice-walk]
closed = true

[[routes.nice-walk.points]]
lat = 51.5024
lon = -0.1421

[[routes.nice-walk.points]]
lat = 51.5035
lon = -0.1437

[[routes.nice-walk.points]]
lat = 51.5027
lon = -0.1480

That's the layout imhp writes. If you're editing by hand, the compact equivalent also works: points = [{ lat = 51.5024, lon = -0.1421 }, { lat = 51.5035, lon = -0.1437 }].

How it works

imhp ──usbmuxd (USB or Wi-Fi) -> lockdownd -> CoreDeviceProxy tunnel (CDTunnel)
     ──userspace TCP/IP -> RemoteServiceDiscovery -> DVT instruments -> LocationSimulation

All of this uses idevice, a pure-Rust implementation of Apple's device protocols. That means no libimobiledevice, no Python and no root/TUN device. iOS only keeps a simulated location while the instruments connection stays open, so each device gets a small session task. It re-sends the position every 5 seconds and clears it on exit.

Security notes

  • Map server (imhp serve): binds to 127.0.0.1 only. Every API and tile call needs a random 256-bit token that's generated per run, kept in the URL fragment (never sent over the network or in the Referer header), and compared in constant time. Host and Origin headers are checked to block DNS-rebinding and cross-site requests.
  • Desktop app: doesn't listen on any port. Requests from its own webview are answered in-process, and the page has no access to Tauri's native commands.
  • Page: everything is same-origin under a strict CSP. Leaflet 1.9.4 is bundled in web/vendor/ (BSD-2-Clause, checked against its published SRI hashes), and nothing loads from a CDN.
  • Tile keys: kept in a git-ignored .env, used only by the backend, and never logged. The key is stripped from error messages and only request paths are logged.
  • Inputs: coordinates are range-checked when parsed and again at every API boundary. GPX files are size-capped and routes are capped at 50,000 points. DDI manifest paths can't escape their folder. Preset and route names are restricted to [A-Za-z0-9_-], which also keeps the export filename header safe.
  • DDI download: imhp ddi fetch pulls from a pinned commit of doronz88/DeveloperDiskImage over HTTPS and checks every file's SHA-256 before writing it. If Xcode is installed, its copy is used instead.
  • Pairing records: a pairing record gives full access to the device. imhp warns if one passed via --pairing-file is readable by other users, and never logs one.
  • Code: #![forbid(unsafe_code)]. Only the idevice features this tool needs are enabled. CI runs cargo deny (RustSec advisories, licences, sources).

Development

crates/core      imhp-core: device sessions, DDI, routes, potter, library, tile proxy, and the UI's API
crates/cli       imhp: the command line (`imhp serve` mounts the API over TCP)
crates/desktop   imhp-desktop: Tauri app (mounts the same API in-process)
web/             the UI (HTML/CSS/JS + vendored Leaflet), embedded into both
cargo test --workspace
cargo clippy --workspace --all-targets
cargo fmt --all

Plain cargo build and cargo test cover the core and CLI only. Add -p imhp-desktop or --workspace to include the desktop app.

Limitations

  • iOS 17 and later only, by design.
  • One imhp process can drive several devices (the map UI has a device picker). The CLI commands drive one device at a time; to do more at once, run several with different --udid.
  • Some apps detect simulated locations (CLLocation.sourceInformation.isSimulatedBySoftware). That's expected, and it's useful for testing your app's own behaviour when it happens.

About

A small project that spoofs GPS location data on iOS devices

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages