Skip to main content
@capgo/capacitor-mock-location-detector Auth & Security Open source

Mock Location Detector Capacitor plugin

Detect simulated GPS locations and developer tooling that enables spoofing apps

Install

bun add @capgo/capacitor-mock-location-detector bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-mock-location-detector
  • pnpm add @capgo/capacitor-mock-location-detector
  • yarn add @capgo/capacitor-mock-location-detector

Guide

How to use Mock Location Detector in Capacitor

Using @capgo/capacitor-mock-location-detector

Detect simulated GPS locations using layered, App Store-safe checks on iOS and Android.

Install

bun add @capgo/capacitor-mock-location-detector
bunx cap sync

What This Plugin Exposes

  • analyze - Run all available checks and return a scored composite result.
  • runCheck - Execute one named detection layer.
  • getCapabilities - Discover supported checks on the current platform.
  • startMonitoring / stopMonitoring - Periodic analysis with events.
  • openDeveloperSettings - Guide users to disable developer or mock tooling.

Example Usage

import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';

const result = await MockLocationDetector.analyze({
  requestLocationSample: true,
  minDetectedChecks: 1,
});

if (result.isSimulated) {
  console.warn('Possible GPS spoofing detected', result.checks);
}

await MockLocationDetector.openDeveloperSettings();

Full Reference

FAQ

Mock Location Detector plugin FAQ

How do I install the Mock Location Detector plugin in a Capacitor app?

Run "bun add @capgo/capacitor-mock-location-detector" (or "npm install @capgo/capacitor-mock-location-detector"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-mock-location-detector" in your app code.

Does @capgo/capacitor-mock-location-detector work with React, Vue and Angular?

Yes. Mock Location Detector is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-mock-location-detector support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-mock-location-detector free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-mock-location-detector/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Mock Location Detector without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Mock Location Detector changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo