adb shell *** 作

adb shell  *** 作,第1张

1、adb shell 获取设置数据库中的值

adb shell settings get global multi_sim_data_call

adb shell settings put global mobile_data1 0

2、adb shell 来获取IMEI2

interface IPhoneSubInfo {

    /**
     * Retrieves the unique device ID, e.g., IMEI for GSM phones.
     */
    String getDeviceId(String callingPackage);

     /**
     * Retrieves the unique Network Access ID
     */
    String getNaiForSubscriber(int subId, String callingPackage);

    /**
     * Retrieves the unique device ID of a phone for the device, e.g., IMEI
     * for GSM phones.
     */
    String getDeviceIdForPhone(int phoneId, String callingPackage);

    /**
     * Retrieves the IMEI.
     */
    String getImeiForSubscriber(int subId, String callingPackage);
....
}


adb shell service call iphonesubinfo 3 i32 1 s16 "com.android.phone"

iphonesubinfo                             表示增加到Servicemanager 中的服务

3                                                  表示调用IPhoneSubInfo.aidl的第三个函数getDeviceIdForPhone

i32                                               i32表示传递int整形

1                                                  表示getDeviceIdForPhone第一个参数phoneId为1

s16                                              s16表示传递字符串

"com.android.phone"                  表示getDeviceIdForPhone第一个参数callingPackage为"com.android.phone"


获取IMEI2方法如下:

adb shell "service call iphonesubinfo 3 i32 1 s16 "com.android.phone" | grep -o '[0-9a-f]\{8\} ' | tail -n+3 | while read a; do echo -n \\u${a:4:4}\\u${a:0:4}; done"

3、adb shell 启动设置界面

设置主页面

adb shell am start com.android.settings/com.android.settings.Settings


启动5G设置界面

adb shell am start -n com.android.settings/com.android.settings.SubSettings -e :settings:show_fragment com.android.settings.development.Prefer5GNetworkListFragment

4、adb shell 杀死进程

adb shell "ps -A | grep rild|grep -v grep|awk 'NR==1 {print $1}' | xargs kill -9"

5、adb shell 设置 prefapn

adb shell content update --uri content://telephony/carriers/preferapn_no_update/subId/1 --bind apn_id:i:1292

其中1为subid,1292为apnid


查询

adb shell content query --uri content://telephony/carriers/preferapn_no_update/subId/1

详细使用方法,请使用adb shell content查询

6、adb shell 设置默认网络制式

1、adb pull system/build.prop

2、修改ro.telephony.default_network值

3、adb push build.prop system/

4、恢复出厂设置
 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/993051.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存