A small Android app that sets your phone's location using Android's built-in mock location developer feature. No root required.
It does two things:
- Set Location — type an address / place name (or
lat,lng) and your phone reports that exact spot. - Simulate Trip — pick a start and an end, choose how many minutes the trip should take, and the phone moves smoothly along the path between them (with realistic speed + bearing). Optional ping-pong looping.
Mock location is a standard developer/testing feature. Use it on devices and accounts you own. Some apps that enforce location integrity (banking, some games) detect mock providers and may refuse to cooperate.
A ready-to-install, signed APK is already in this folder:
LocationSpoofer.apk
- Package:
com.locationspoofer· min Android 13 (API 33) · target API 36 - Signed with a debug key (scheme v3), so it sideloads fine.
Copy LocationSpoofer.apk to the phone and open it (Files app → tap the APK), or
over ADB:
adb install -r LocationSpoofer.apk
Allow "install unknown apps" if prompted.
Android only honors mock locations from an app you explicitly authorize:
- Settings → About phone → tap Build number 7 times to unlock Developer options.
- Settings → System → Developer options → Select mock location app → choose Location Spoofer.
- Launch the app and grant Location + Notifications when asked. For best results set its location permission to Allow all the time / Precise.
If you skip step 2 the app will show "Mock location not allowed…".
- Set Location: enter
Eiffel Toweror48.8584,2.2945, tap Teleport here. A persistent notification shows it's active; the position holds until you stop. - Simulate Trip: fill Start, End, and duration (minutes), then Start trip. Tick Loop to bounce back and forth forever.
- Stop mocking (button or the notification's Stop action) clears everything and your real GPS takes over again.
Address lookup uses Android's Geocoder and needs a network connection; pure
lat,lng works offline.
Everything builds on the phone inside Termux PRoot Debian (aarch64) — no
Android Studio, no Gradle. The trick is that Google's aapt2 is x86_64-only, so
we use Termux's native aarch64 aapt2 plus platform android.jar, r8 (dexer)
and apksigner (both pure-Java).
./setup-toolchain.sh # one time: downloads JDK + SDK pieces (~150 MB) ./build.sh # produces LocationSpoofer.apk
build.sh is incremental-free (clean build each run) and re-signs with a debug
keystore it generates on first use (debug.keystore).
app/src/main/AndroidManifest.xml
app/src/main/res/layout/activity_main.xml
app/src/main/java/com/locationspoofer/
MainActivity.java UI, permissions, address→coords resolution
MockLocationService.java foreground service feeding GPS/NETWORK/FUSED providers
GeoUtils.java haversine distance, bearing, great-circle interpolation
build.sh compile → dex → package → sign
setup-toolchain.sh assembles the aarch64 build toolchain
Android lets go of a mocked position unless something keeps pushing updates, so
MockLocationService runs as a foreground service and re-publishes the location
once per second to the gps, network, and fused providers at once (covering
apps that read any of them). For trips it interpolates along the great circle
between start and end based on elapsed time.
- The launcher icon is a stock system glyph (keeps the build dependency-free).
- Altitude is reported as 0; accuracy is reported as ~1 m.
- Trips interpolate a straight great-circle line, not real road routing.
- Targets API 36 but compiles against the API 33 stubs (every API the app uses
exists in 33); this keeps it within range of the aarch64
aapt2build.