adb命令输入下面两行 亲测可用
Android 5.0~7.1.0
设置
adb shell "settings put global captive_portal_server 204.yuyangzhou.name"
恢复
adb shell "settings delete global captive_portal_server"
Android 7.1.1+ (包括8.x、9.0)
设置
adb shell "settings put global captive_portal_http_url http://204.yuyangzhou.name/generate_204"
adb shell "settings put global captive_portal_https_url https://204.yuyangzhou.name/generate_204"
恢复
adb shell "settings delete global global captive_portal_http_url"
adb shell "settings delete global global captive_portal_https_url"