![]() ![]() This information can be obtained from the dump of connectivity service. If ] thenīy knowing the state I suppose you meant whether at X point of time the Wi-Fi or mobile data is enabled or disabled. To toggle use bash script that checks state and then switch on/off like: #!/bin/bash Get state: adb shell settings get global airplane_mode_onĪdb shell settings get global mobile_dataĪdb shell settings get global bluetooth_onĪdb shell settings put global airplane_mode_on 1Īdb shell am broadcast -a _MODEĪdb shell settings put global airplane_mode_on 0Īdb shell settings put global bluetooth_disabled_profiles 1Īdb shell settings put global bluetooth_disabled_profiles 0 the modem state switching bash script is located at /usr/local/bin so I can run it from the console just by writing the filename. I have samsung a50(android 10) and ubuntu 20. for wifi-hotspot i use same first line,key20 key66 key20 key66. keyevent 20 - simulates key press down, keyevent 66 - enter. (unlike first two commands above the screen may be off, but the phone must be unlocked): adb shell am start -n /.TetherSettingsįirst line opens the settings page. I also use such commands to switch the wifi-hotspot and usb-modem Is there a way to switch it when the phone is locked? Maybe there is a command that returns the state of the Wi-Fi or mobile data? Like adb shell svc data state. But I don't know a way to switch the state with one command like "adb shell svc data toggle". I'm use adb shell svc data enable/disable Is it possible to switch the state of the wifi-hotspot and the usb-modem via abd? If this is not possible then the question is how to find out the state of wifi and mobile data using adb? you send several commands and then you are sure that the wifi state changed.) (for example for wifi: if you don't know the state of the wifi now. Is it possible to switch(not only on or off) the state of the mobile data and wifi using adb?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |