Is it possible to check via ADB if the phone is connected to a cellular network?
I had a look at ConnectivityManager, but it is for android application development.
Android Shell Commands. ADB is Android Debug Bridge which is a command line utility included with Google's Android SDK. It provides a terminal interface to control your Android device connected to a computer using a USB. ADB can be used to run shell commands, transfer files, install/uninstall apps, reboot and more.
Connect to your device using USB You can also use adb to issue commands, as follows: Verify that your device is connected by running the adb devices command from your android_sdk /platform-tools/ directory. If connected, you'll see the device listed. Issue any adb command with the -d flag to target your device.
Certainly using the command from shell :
dumpsys telephony.registry
or directly from adb :
adb shell dumpsys telephony.registry
The values of mServiceState or mDataConnectionState will help you. I tried in Plane mode mServiceState=3 / mDataConnectionState=0 and connected to the cellular network : mServiceState=0 / mDataConnectionState=2
PS: I'm using an Android 4.4 phone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With