Adb shell命令打电话测试4G
Adb shell命令打電話測試4G
在沒有顯示屏的情況下,怎么測試4G的打電話和上網功能:
1.上網功能測試
用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命令獲取到相關的信息:
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根據上面的測試結果,表示上網功能ok。
2.打電話測試
要測試這個功能,需要用adbshell service list查看android系統中有哪些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提供一些接口供其他進程調用。PhoneInterfaceManager是一個Service,在被創建時通過ServiceManager注冊自己,他作為Telephony對外的接口,可以接受其他進程向Telephony的請求,我們通過該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: 執行的service名稱
CODE: 執行的方法id值
[i32INT | s16 STR]:參數類型以及緊跟參數值,i32代表int類型,s16代表String類型。
比如ITelephony的第1個方法dial用法
adbshell service call phone 1 s16 "10000"
Result:Parcel(00000000 '.…')
此方法只是顯示撥號界面,還需要點擊撥號圖標才會撥號.
我們可以通過手機往設備打電話.然后通過11和3方法來判斷.11方法是isIdle(),3方法是en3dCall().
root@xxx:~#adb shell service call phone 11---------------此時手機給設備打電話,查詢狀態結果為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------------再查詢狀態為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操作手機打電話、發短信
http://blog.csdn.net/jethai/article/details/52345081
adbshell命令整理之service
http://blog.csdn.net/mr_oldcold/article/details/53761759
總結
以上是生活随笔為你收集整理的Adb shell命令打电话测试4G的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用Jack编译
- 下一篇: Android5.1修改以太网MAC地址