I found a way to find active geofences from this forum.
Use
adb shell service dumpsys activity service com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerService
Since Geofences are handled by Google's Play Services API, it makes sense that you could find active Geofences from this service.
Some parts of the output that may be of interest to you:
View geofences registered, grouped by package:
Geofencer State:
Registered geofences:
Active Geofences:
Package: com.google.android.gms Tag: geotimezone, count: 4
Geofence[CIRCLE id:time-zone-00e3f64-2 transitions:1 0.000000, 00.332665 10001260m, resp=900s, dwell=-1ms, @-1] it=5, d=UNKNOWN ? com.google.android.gms
Geofence[CIRCLE id:time-zone-00e3f64-3 transitions:1 00.170901, 00.000000 10001260m, resp=900s, dwell=-1ms, @-1] it=5, d=UNKNOWN ? com.google.android.gms
Geofence[CIRCLE id:time-zone-00e3f64-1 transitions:1 -00.209155, -00.000000 10001260m, resp=900s, dwell=-1ms, @-1] it=5, d=UNKNOWN ? com.google.android.gms
Geofence[CIRCLE id:time-zone-00e3f64-0 transitions:1 0.000000, -161.714795 10001260m, resp=900s, dwell=-1ms, @-1] it=5, d=UNKNOWN ? com.google.android.gms
...
Counters (how many times certain geofence activities are registered):
Counters:
locationRequests: 2
locationReceived: 0
sentinelFenceUpdatesNonChre: 0
sentinelFenceUpdatesChre: 0
geofenceCountMaximum: 8
com.google.android.gms:geotimezone:
addGeofenceRequests: 1
removeGeofenceRequests: 0
geofenceEnters: 0
geofenceExits: 0
geofenceDwells: 0
geofenceCountMaximum: 4
transition/initial(1/5): 8
There's a lot more to the output of this particular activity's sysdump
, but I just extracted what seemed to me were the most relevant for debugging an application with geofencing capabilities.
You could probably also filter what you want with dumpsys ... | grep
if that's important to you.