其他分享
首页 > 其他分享> > ADB命令横竖屏切换、关闭打开wifi

ADB命令横竖屏切换、关闭打开wifi

作者:互联网

禁用自动旋转
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

旋转屏幕
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
i后面跟的不同的值代表旋转为不同的方向,取值范围为0,1,2,3

#!bin/bash
i=0
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
while [ "$i" -lt 100 ]; do
echo "$i"
adb  shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
sleep 0.5
adb  shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
i=$(($i+1))
sleep 0.5
done

 

ADB命令关闭打开wifi

#!bin/bash

#开关wifi次数验证
i=1
while true
do
adb shell svc wifi disable
sleep 1
adb shell svc wifi enable
sleep 1
echo "开关次数" $i
((i=$i+1))

done

或者

#!bin/bash

i=1
while true
do
adb shell < open-wifi.txt
echo "开关次数" $i
((i=$i+1))
done

#open-wifi.txt文档写

su
svc wifi disable
sleep 5
svc wifi enable
sleep 5

标签:shell,--,bind,横竖,wifi,content,ADB,adb
来源: https://www.cnblogs.com/lyongyong/p/15184395.html