adb脚本操作

用荣耀80手机测试

@echo off

setlocal enabledelayedexpansion

adb shell am start com.android.settings

timeout /t 2 /nobreak >nul

adb shell input tap 500 1300

timeout /t 2 /nobreak >nul

adb shell input tap 500 800

timeout /t 2 /nobreak >nul

adb shell input tap 900 350

timeout /t 2 /nobreak >nul

adb shell ps | findstr wifi |findstr hostapd >nul

if %errorlevel% equ 0 (

echo tether exists

) else (

echo tether dont exist

adb shell input keyevent KEYCODE_HOME

adb shell am start com.android.settings

timeout /t 2 /nobreak >nul

adb shell input tap 500 1300

timeout /t 2 /nobreak >nul

adb shell input tap 500 800

timeout /t 2 /nobreak >nul

adb shell input tap 900 350

timeout /t 2 /nobreak >nul

)

netsh wlan connect name=die

timeout /t 2 /nobreak >nul

netsh wlan show interfaces | findstr die >nul

timeout /t 2 /nobreak >nul

if %errorlevel% equ 0 (

echo wifi connect successfully

) else (

echo wifi connection fails

timeout /t 2 /nobreak >nul

netsh wlan connect name=die

)

set d=%data%

set t=%time%

set /A cnt=0

set /A acc=0

set /A num=5

set /A sum=-1

for /f "tokens=*" %%a in ('ping -n !num! www.baidu.com')do (

set /A sum+=1

if !sum! LSS !num! (

if !sum! GTR -1 (

echo %d% %t% %%a>>pi.txt

echo %%a | findstr "TTL" >nul

if %errorlevel% equ 0 (

set /A cnt+=1

set /A acc+=1

echo %d% %t% success now count:!cnt! now acc:!acc! >>log.txt

)

if %errorlevel% NEQ 0 (

set /A cnt+=1

echo %d% %t% fail now count:!cnt! now acc:!acc! >>log.txt

)

)

)

)

pause

相关推荐
·云扬·1 天前
MySQL Binlog落盘机制深度解析:性能与安全性的平衡艺术
android·mysql·adb
天马37981 天前
MySql9 免安装版_配置和启动_MySql9安装
adb·mysql9 免安装版·mysql9安装
·云扬·2 天前
MySQL Binlog 配置指南与核心作用解析
数据库·mysql·adb
darling3312 天前
mysql 自动备份以及远程传输脚本,异地备份
android·数据库·mysql·adb
Remember_9932 天前
MySQL 索引详解:从原理到实战优化
java·数据库·mysql·spring·http·adb·面试
多多*3 天前
2月3日面试题整理 字节跳动后端开发相关
android·java·开发语言·网络·jvm·adb·c#
数据蜂巢3 天前
MySQL 8.0 生产环境备份脚本 (Percona XtraBackup 8.0+)
android·mysql·adb
vistaup4 天前
通过ADB 触发gc
adb
Tangcan-4 天前
【MySQL】 事务
数据库·mysql·adb
qinyia4 天前
在Ubuntu 22.04.5 LTS上安装MySQL 8并设置root密码的完整协作流程
mysql·ubuntu·adb