日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Adb shell命令打电话测试4G

發布時間:2025/4/16 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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.17ip地址


然后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 listandroid系統中有哪些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]…………..

phoneservice提供一些接口供其他進程調用。PhoneInterfaceManager是一個Service,在被創建時通過ServiceManager注冊自己,他作為Telephony對外的接口,可以接受其他進程向Telephony的請求,我們通過該Service所繼承的AIDL文件就能看到他所提供的具體功能:


frameworks/base/telephony/java/com/android/internal/telephony/*** Interface used to interact with the phone. Mostly this is used bythe* TelephonyManager class. A few places are still using thisdirectly.* Please clean them up if possible and use TelephonyManager instead.** {@hide}*/interfaceITelephony {/*** Dial a number. This doesn't place the call. It displays* the Dialer screen.* @param number the number to be dialed. If null, this* would display the Dialer screen with no number pre-filled.*/void dial(String number);/*** Place a call to the specified number.* @param callingPackage The package making the call.* @param number the number to be called.*/void call(String callingPackage, String number);/*** End call if there is a call in progress, otherwise doesnothing.** @return whether it hung up*/boolean en3dCall();…}

具體怎么用呢.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 '.…')

此方法只是顯示撥號界面,還需要點擊撥號圖標才會撥號.


我們可以通過手機往設備打電話.然后通過113方法來判斷.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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。