adb shell settings ....

Source: Internet
Author: User
Tags appium

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:

private static void Printusage () {

System.err.println ("usage:settings [--user NUM] Get namespace key");

SYSTEM.ERR.PRINTLN ("Settings [--user NUM] put namespace key value");

System.err.println ("\ n ' namespace ' is one of {system, secure, global}, case-insensitive");

System.err.println ("If '--user NUM ' is not given, the operations was performed on the owner user.");

}

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:

#获取系统默认输入法

#默认搜狗输入法

C:\USERS\ADMINISTRATOR>ADB shell settings Get secure Default_input_method

com.sohu.inputmethod.sogouoem/. Sogouime

#默认为Appium使用中文输入时安装的输入法

C:\USERS\ADMINISTRATOR>ADB shell settings Get secure Default_input_method

io.appium.android.ime/. Unicodeime

#put命令更改默认输入法 (Will io.appium.android.ime/. Unicodeime changed to com.sohu.inputmethod.sogouoem/. Sogouime)

C:\USERS\ADMINISTRATOR>ADB shell settings put secure Default_input_method com.sohu.inputmethod.sogouoem/. Sogouime

#获取亮度是否为自动获取

C:\USERS\ADMINISTRATOR>ADB shell settings Get system Screen_brightness_mode

1

#获取当前亮度值

C:\USERS\ADMINISTRATOR>ADB shell settings Get system screen_brightness

30

#更改亮度值 (brightness value between 0-255)

C:\USERS\ADMINISTRATOR>ADB shell settings put system screen_brightness 150

#获取屏幕休眠时间

C:\USERS\ADMINISTRATOR>ADB shell settings Get system screen_off_timeout

15000

#更改休眠时间, 10 minutes

C:\USERS\ADMINISTRATOR>ADB shell settings put system screen_off_timeout 600000

#获取日期时间选项中通过网络获取时间的状态, 1 is allowed, 0 is not allowed

C:\USERS\ADMINISTRATOR>ADB shell settings Get global auto_time

1

#更改该状态, changed from 1 to 0

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 ....

Related Article

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.