Diagnostic Guide

Android Mock Location Not Working: Causes & Fixes

If Mockery Spoofer reports Mock provider: Not configured, or your simulated location freezes when the phone locks, work through these proven fixes for common Android OEM behavior.

Issue 1: Mock Provider Resets After Device Reboot

Common on Samsung / Xiaomi

On several custom Android skins (Samsung One UI, Xiaomi HyperOS/MIUI, and Huawei EMUI), the operating system automatically unsets the designated mock location application every time the phone powers off or restarts for security.

The Fix:
  1. Open Android Settings > Developer options.
  2. Scroll to Select mock location app.
  3. Tap Mockery to re-authorize the test provider.
  4. Verify in Mockery Spoofer that the status returns to Mockery ✓.

Issue 2: Simulation Stops When Screen Turns Off

OEM Background Killer

Mockery runs a native Kotlin Foreground Service with a persistent notification. However, OEM battery-saving software (such as Samsung Device Care or Xiaomi Battery Saver) may aggressively suspend background network sockets or kill foreground services when the screen locks.

The Fix (Set Battery to Unrestricted):
  1. Long-press the Mockery app icon on your home screen and tap App info (ⓘ).
  2. Tap Battery (or Battery usage).
  3. Change the setting from Optimized to Unrestricted.
  4. On Samsung: Go to Settings > Battery > Background usage limits and ensure Mockery is listed under Never sleeping apps.

Issue 3: Target App Ignores Mock Location

Android 12+ Permission

Starting in Android 12, users can grant either Precise or Approximate location to applications. If your target app under test (e.g. Google Maps or your company's app) was only granted Approximate location, Android obscures the location to a 2km bounding area, ignoring precise mock coordinates.

The Fix:
  1. Open Android Settings > Apps and select the target app under test.
  2. Tap Permissions > Location.
  3. Ensure Use precise location is toggled ON.

Issue 4: Developer Options Disabled by Enterprise Policy

If your Android device is managed by an employer or enrolled in a Mobile Device Management (MDM) profile (e.g. Microsoft Intune, VMware Workspace ONE), the administrator may have remotely disabled Developer Options.

Resolution: Developer Options cannot be unlocked on MDM-restricted devices without administrative policy exemption. We recommend using a dedicated personal testing phone or a factory-reset lab device.

Resolved the Issue?

Open the Mockery Spoofer Monitor and verify active location injection.