Im automating wifi on / off via adb.
I would like to either disable / enable wifi based on test case
so far i have found good information here
However, I want to test the connection before running the following command
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings adb shell input keyevent 19 & adb shell input keyevent 19 & adb shell input keyevent 23
The above command disables wifi if enabled, enables wifi if disabled. First I want to check the connection and take action if necessary. I am wondering if there is a way to do this with the adb command. This can be achieved programmatically, but I want it to be done via adb to make it more reliable.
Also, the following command only works if the device is rooted
adb shell "svc wifi enable"
Also, the following command starts the test on the screen, but does not provide information through adb
adb shell am start -n com.android.settings/.wifi.WifiStatusTest