Headless Control
XposedFakeLocation can expose a BroadcastReceiver that lets any app — or adb shell — control spoofing without opening the UI.
Enabling
The receiver is off by default. To turn it on:
Settings → External Control → “Allow external broadcast control”
Actions
| Action | Extras | Effect |
|---|---|---|
com.noobexon.xposedfakelocation.action.START |
optional latitude (double), longitude (double) |
Starts spoofing. If lat/lon are provided, updates the location first. |
com.noobexon.xposedfakelocation.action.STOP |
— | Stops spoofing. |
com.noobexon.xposedfakelocation.action.SET_LOCATION |
required latitude (double), longitude (double); optional accuracy (float); optional start (boolean) |
Updates the fake location. If start=true, also starts spoofing. |
Latitude is clamped to [-90, 90], longitude to [-180, 180], accuracy must be finite and in [0, 100000] m.
adb examples
# Start faking at the last-set locationadb shell am broadcast \ -a com.noobexon.xposedfakelocation.action.START \ -n com.noobexon.xposedfakelocation/.manager.control.ControlReceiver
# Start faking at specific coordinatesadb shell am broadcast \ -a com.noobexon.xposedfakelocation.action.START \ -n com.noobexon.xposedfakelocation/.manager.control.ControlReceiver \ --ed latitude 37.7749 --ed longitude -122.4194
# Update location without startingadb shell am broadcast \ -a com.noobexon.xposedfakelocation.action.SET_LOCATION \ -n com.noobexon.xposedfakelocation/.manager.control.ControlReceiver \ --ed latitude 48.8566 --ed longitude 2.3522 --ef accuracy 5.0
# Update location and immediately startadb shell am broadcast \ -a com.noobexon.xposedfakelocation.action.SET_LOCATION \ -n com.noobexon.xposedfakelocation/.manager.control.ControlReceiver \ --ed latitude 48.8566 --ed longitude 2.3522 --ez start true
# Stop fakingadb shell am broadcast \ -a com.noobexon.xposedfakelocation.action.STOP \ -n com.noobexon.xposedfakelocation/.manager.control.ControlReceiverKotlin caller snippet
import android.content.Contextimport android.content.Intent
object FakeLocationControl { private const val PKG = "com.noobexon.xposedfakelocation" private const val RECEIVER = "$PKG.manager.control.ControlReceiver"
fun start(context: Context, lat: Double? = null, lon: Double? = null) { val intent = Intent("$PKG.action.START").apply { setClassName(PKG, RECEIVER) if (lat != null && lon != null) { putExtra("latitude", lat) putExtra("longitude", lon) } } context.sendBroadcast(intent) }
fun stop(context: Context) { context.sendBroadcast(Intent("$PKG.action.STOP").apply { setClassName(PKG, RECEIVER) }) }
fun setLocation( context: Context, lat: Double, lon: Double, accuracy: Float? = null, startFaking: Boolean = false, ) { val intent = Intent("$PKG.action.SET_LOCATION").apply { setClassName(PKG, RECEIVER) putExtra("latitude", lat) putExtra("longitude", lon) if (accuracy != null) putExtra("accuracy", accuracy) if (startFaking) putExtra("start", true) } context.sendBroadcast(intent) }}No <uses-permission> is needed in the caller app’s manifest.