獲取系統(tǒng)默認(rèn)輸入法
-默認(rèn)搜狗輸入法
C:\Users\Administrator>adb shell settings get secure default_input_method
com.sohu.inputmethod.sogouoem/.SogouIME
-默認(rèn)為Appium使用中文輸入時(shí)安裝的輸入法
C:\Users\Administrator>adb shell settings get secure default_input_method
io.appium.android.ime/.UnicodeIME
-put命令更改默認(rèn)輸入法(將io.appium.android.ime/.UnicodeIME
改為com.sohu.inputmethod.sogouoem/.SogouIME
)
C:\Users\Administrator>adb shell settings put secure default_input_method com.sohu.inputmethod.sogouoem/.SogouIME
獲取亮度是否為自動(dòng)獲取
C:\Users\Administrator>adb shell settings get system screen_brightness_mode
1
獲取當(dāng)前亮度值
C:\Users\Administrator>adb shell settings get system screen_brightness
30
更改亮度值(亮度值在0—255之間)
C:\Users\Administrator>adb shell settings put system screen_brightness 150
獲取屏幕休眠時(shí)間
C:\Users\Administrator>adb shell settings get system screen_off_timeout
15000
更改休眠時(shí)間惹骂,10分鐘
C:\Users\Administrator>adb shell settings put system screen_off_timeout 600000
獲取日期時(shí)間選項(xiàng)中通過網(wǎng)絡(luò)獲取時(shí)間的狀態(tài)渠脉,1為允許、0為不允許
C:\Users\Administrator>adb shell settings get global auto_time
1
更改該狀態(tài)递览,從1改為0
C:\Users\Administrator>adb shell settings put global auto_time 0
以及獲取誊薄、修改wifi狀態(tài)(wifi_on)胚想、飛行模式(airlpane_mode_on)等于微,這里也是appium中g(shù)etNetworkConnection獲得設(shè)備網(wǎng)絡(luò)狀態(tài)的方法。
禁用自動(dòng)旋轉(zhuǎn)
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
旋轉(zhuǎn)屏幕
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
i后面跟的不同的值代表旋轉(zhuǎn)為不同的方向育瓜,取值范圍為0,1栽烂,2躏仇,3