adb getprop setprop watchprop用法

來源:互聯網
上載者:User

標籤:

在android系統中,有一些初始化的設定檔,例如:

    /init.rc      /default.prop      /system/build.prop  

 

檔案裡面裡面配置了開機設定的系統屬性值,這些屬性值,可以通過getprop擷取,setprop設定。

其實這三個命令都是toolbox的子命令,如果有興趣的可以看在android源碼中看到其對應的源碼:

system/core/toolbox/

1、getprop[key]

擷取指定key的配置值,如果不帶參數,只是getprop則是顯示系統所有的配置值,輸入命令:

#getprop
[dhcp.wlan0.dns1]:[127.0.0.1]
[dhcp.wlan0.gateway]:[xxx.xx.xx.xx]

 

 2、setprop[key] [value] 設定指定key的屬性值

如:setprop

    [email protected]:/ # getpropdhcp.wlan0.leasetime   //得到的值為3600      3600      [email protected]:/ # setprop dhcp.wlan0.leasetime 3000  //設定值為3000      [email protected]:/ # getprop      [dhcp.wlan0.ipaddress]: [127.0.0.1]      [dhcp.wlan0.leasetime]:[3000]                    //再用getporp查看設定的值      [dhcp.wlan0.mask]: [255.255.255.0]  

 

3、watchprops

監聽系統屬性的變化,如果期間系統的屬性發生變化則把變化的值顯示出來

    /system # watchprops      xxxxxxxxxx sys.settings_system_version = ‘37‘      xxxxxxxxxx sys.settings_system_version =‘38‘      xxxxxxxxxx persist.sys.timezone =‘Asia/Hong_Kong‘  

 

adb getprop setprop watchprop用法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.