adb shell settings get global captive_portal_detection_enabled
disable detection
adb shell settings put global captive_portal_detection_enabled 0enable detection:
adb shell settings put global captive_portal_detection_enabled 1
Before Android 7.1
adb shell settings get global captive_portal_serveradb shell settings put global captive_portal_server "http.url"
After Android 7.1
adb shell settings get global captive_portal_http_url
adb shell settings put global captive_portal_http_url "http.url"