Follow the steps -:
1) Go to the Google Play store and download Fake GPS Go.
2) Once you finish installing, head to your Phone settings> Developers Options. If you have Marshmallow Android version, it may be locked. You can easily unlock Developer options with just a few taps on Build number.
3) Once the develops options is unlocked, head to Settings>Develops Options> Select mock location app > and select Fake GPS.
4) Open the Fake GPS Go app & grant the permissions by tapping on Request Permissions & the tap on PROCEED.
5) Tap on Select Location and it will show your location on the map. Drag & drop the red location marker at your desired position & tap Select this location.
Tap on Set Location once to fake your location. Tap on it again to avoid ” Failed to detect Location” error.
6) Open the Pokemon Go game and your character will be at your chosen location.
That’s it. Now you can switch bme and app to keep changing location.