Is it possible to use the android api functions from the adb? If its possible, what is the syntax to do so? For example I'd like to call the "DATA_CONNECTED" function from android.telephony and get its return value. Link: http://developer.android.com/reference/android/telephony/TelephonyManager.html#CALL_STATE_OFFHOOK
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is no DATA_CONNECTED
function in Android TelephonyManager. It is a 0x00000002
constant - one of possible response codes to the getDataState()
function.
The way you call getDataState()
from adb shell
is:
service call phone 32
Update: if your phone runs anything older than jb-mr2, the command should be:
service call phone 31
P.S. just finished my write-up on Calling Android services from ADB shell - it includes a small bash script to look up calling codes for any service/method for a specific device.