ADB shell settings control Android system settings

Source: Internet
Author: User

Android4.2 Source Android-17\com\android\commands Directory is more than the previous version of a settings command to view the Settingscmd.java file, at the end of the command to help information:

 1  private  static  void   Printusage () { 2  System.err.println ("USAG e:settings [--user NUM] Get namespace key " 3  System.err.println ("Settings [--user NUM] put namespace key value"  4  System.err.println ("\ n ' namespace ' is one of {System, secure, global}, Case-i Nsensitive " 5  System.err.println ("If '--user NUM ' is not given, the operations is perform Ed on the owner user. "  6 } 

The key in the options why value, it is difficult to see from the Help information, viewing from the code that the key value is defined in Android.provider.Settings.
Http://developer.android.com/reference/android/provider/Settings.System.html

This command makes it easy to change the parameters in the system settings (such as modifying the system default Input method) and gives several examples of using the command:

1 #获取系统默认输入法2 #默认搜狗输入法3C:\users\administrator>adb shell settings get secure Default_input_method4com.sohu.inputmethod.sogouoem/. Sogouime5 6 #默认为Appium使用中文输入时安装的输入法7C:\users\administrator>adb shell settings get secure Default_input_method8io.appium.android.ime/. Unicodeime9 Ten#put命令更改默认输入法 (Will io.appium.android.ime/. Unicodeime Change to com.sohu.inputmethod.sogouoem/. Sogouime) OneC:\USERS\ADMINISTRATOR>ADB shell settings put secure Default_input_method com.sohu.inputmethod.sogouoem/. Sogouime
 1   #获取亮度是否为自动获取  2  c:\users\administrator>adb shell settings Get system Screen_brightness_mode  3  14   #获取当前亮度值  5  C:\Users\Administrator >adb shell settings get system screen_brightness  6  307  # Change the luminance value (brightness value between 0-255)  8  c:\users\administrator>adb shell settings put System Screen_brightness 
1 #获取屏幕休眠时间 2 c:\users\administrator>adb shell settings get system screen_off_timeout3 150004  #更改休眠时间, 10 minutes 5 c:\users\administrator>adb shell settings put system screen_off_timeout 600000
1 #获取日期时间选项中通过网络获取时间的状态, 1 is allowed, 0 is not allowed 2 c:\users\administrator>adb shell settings get global auto_time3 14 #更改该状态, changed from 1 to 0 5 c:\users\administrator>adb shell settings put global Auto_time 0

As well as acquiring, modifying the WiFi status (wifi_on), Airplane mode (airlpane_mode_on), etc., this is also the method that getnetworkconnection obtains the device network state in Appium.

ADB shell settings control Android system settings (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.