Adb shell命令打电话测试4G
Adb shell命令打電話測(cè)試4G
在沒(méi)有顯示屏的情況下,怎么測(cè)試4G的打電話和上網(wǎng)功能:
1.上網(wǎng)功能測(cè)試
用route命令看路由信息
Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface10.157.91.16 * 255.255.255.252 U 0 0 0 rmnet_d0用ifconfig命令獲取到相關(guān)的信息:
rmnet_data0 Link encap:UNSPECinet addr:10.157.91.17 Mask:255.255.255.252inet6 addr:fe80::87df:218e:da9f:bc8e/64 Scope: LinkUP RUNNING MTU:1500 Metric:1RX packets:44 errors:0dropped:0 overruns:0 frame:0TX packets:56 errors:0dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:33661 TX bytes:4928這里的inet addr:10.157.91.17是ip地址
然后pingwww.baidu.com
PING www.a.shifen.com (163.177.151.110)56(84) bytes of data.64 bytes from 163.177.151.110:icmp_seq=1 ttl=51 time=197 ms64 bytes from 163.177.151.110:icmp_seq=2 ttl=51 time=43.3 ms64 bytes from 163.177.151.110:icmp_seq=3 ttl=51 time=47.4 ms根據(jù)上面的測(cè)試結(jié)果,表示上網(wǎng)功能ok。
2.打電話測(cè)試
要測(cè)試這個(gè)功能,需要用adbshell service list查看android系統(tǒng)中有哪些service,
Found134 services:0 qtitetherservice:[com.qualcomm.qti.tetherstatsextension.ITetherService]1 AtCmdFwd:[com.qualcomm.atfwd.IAtCmdFwd]2 dpmservice:[com.qti.dpm.IDpmService]3 qti.ims.ext:[org.codeaurora.ims.internal.IQtiImsExt]4 ims:[com.android.ims.internal.IImsService]5 sip:[android.net.sip.ISipService]6 com.qualcomm.location.izat.IzatService:[com.qualcomm.location.izat.IIzatService]7 nfc:[android.nfc.INfcAdapter]8 carrier_config:[com.android.internal.telephony.ICarrierConfigLoader]9 phone:[com.android.internal.telephony.Itelephony]…………..phone的service提供一些接口供其他進(jìn)程調(diào)用。PhoneInterfaceManager是一個(gè)Service,在被創(chuàng)建時(shí)通過(guò)ServiceManager注冊(cè)自己,他作為Telephony對(duì)外的接口,可以接受其他進(jìn)程向Telephony的請(qǐng)求,我們通過(guò)該Service所繼承的AIDL文件就能看到他所提供的具體功能:
具體怎么用呢.用adbshell service call phone
service:No service specified for callUsage:service [-h|-?]service listservice check SERVICEservice call SERVICE CODE [i32 N | i64 N | f N | d N | s16 STR] ...Options:i32: Write the 32-bit integer N into the send parcel.i64: Write the 64-bit integer N into the send parcel.f: Write the 32-bit single-precision number N into the sendparcel.d: Write the 64-bit double-precision number N into the sendparcel.s16: Write the UTF-16 string STR into the send parcel.SERVICE: 執(zhí)行的service名稱
CODE: 執(zhí)行的方法id值
[i32INT | s16 STR]:參數(shù)類型以及緊跟參數(shù)值,i32代表int類型,s16代表String類型。
比如ITelephony的第1個(gè)方法dial用法
adbshell service call phone 1 s16 "10000"
Result:Parcel(00000000 '.…')
此方法只是顯示撥號(hào)界面,還需要點(diǎn)擊撥號(hào)圖標(biāo)才會(huì)撥號(hào).
我們可以通過(guò)手機(jī)往設(shè)備打電話.然后通過(guò)11和3方法來(lái)判斷.11方法是isIdle(),3方法是en3dCall().
root@xxx:~#adb shell service call phone 11---------------此時(shí)手機(jī)給設(shè)備打電話,查詢狀態(tài)結(jié)果為1
Result:Parcel(00000000 00000001 '........')
root@xxx:~#adb shell service call phone 3-----------------掛斷電話
Result:Parcel(00000000 00000001 '........')
root@xxx:~#adb shell service call phone 11------------再查詢狀態(tài)為0
Result:Parcel(00000000 00000000 '........')
p { margin-bottom: 0.1in; line-height: 120%; }a:link { }
找到另一種方法:
adbshell am start -a android.intent.action.CALL -d tel:10010
掛斷:adbshell service call phone 3
參考:
adb操作手機(jī)打電話、發(fā)短信
http://blog.csdn.net/jethai/article/details/52345081
adbshell命令整理之service
http://blog.csdn.net/mr_oldcold/article/details/53761759
總結(jié)
以上是生活随笔為你收集整理的Adb shell命令打电话测试4G的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 使用Jack编译
- 下一篇: Android5.1修改以太网MAC地址