简体   繁体   中英

Enable Mock Locations in Android Marshmallow

I cannot get mock locations to work in Android Marshmallow. I have installed app in Android 6.0 . Now, When I want to set mock location for this app by following option.

Setting >> Developer Option >> Select Mock location app

I can not see any Application to select.

Has anyone had success enabling mock locations under Marshmallow?

If you use the Mock location permission:

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

Then you will be able to select your app by Setting >> Developer Option >> Select Mock location app

I was facing the same problem. Even though my app's manifest file (debug build) had the required permission (ACCESS_MOCK_LOCATION), the Select Mock Location app showed no app in the list .

Solution:

I started my application, pressed the home button (to send my app's activity to the background), and then navigated to Settings -> Developer Options -> Select Mock Location App. My app was now visible in the list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM