adb shell settings put secure location_providers_allowed gps,network
adb shell am start -a android.intent.action.SET_CUSTOM_MOCK_LOCATION -d gps://lat-long
For Android 6.0
To Enable use :
For GPS : adb shell settings put secure location_providers_allowed +gps
For Network : adb shell settings put secure location_providers_allowed +network
To Disable :
GPS : adb shell settings put secure location_providers_allowed -gps
For Network : adb shell settings put secure location_providers_allowed -network