12

I'm working on GPS location related App, i'm faceing below issue while genarating Mock Location points to App for testing.

Caused by: java.lang.SecurityException: com.example.geofences from uid 10049 not allowed to perform MOCK_LOCATION

kgsharathkumar
  • 1,369
  • 1
  • 19
  • 36

1 Answers1

25

We need to do two steps:

Step 1: Give a permission in Android Manifest

<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>

Step 2: In your real device,

Go to Setting --> Developer option --> Mock location app option and select your app for testing.

Mock location works fine... :)

Thanks,

kgsharathkumar
  • 1,369
  • 1
  • 19
  • 36