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

相关推荐
qq_283720057 小时前
MySQL技巧(四): EXPLAIN 关键参数详细解释
android·adb
gjc5927 小时前
踩坑实录:MySQL服务器CPU爆高,元凶竟是SELinux的setroubleshootd?
运维·服务器·数据库·mysql·adb
yhole9 小时前
MySQL无法连接到本地localhost的解决办法2024.11.8
数据库·mysql·adb
guslegend9 小时前
MySQL高手第一章
mysql·adb
轩情吖11 小时前
MySQL Connect
数据库·mysql·adb·select·连接·远程访问数据库
恋红尘12 小时前
K8S 高级调度-叩丁狼
adb·容器·kubernetes
qq_2837200512 小时前
MySQL技巧(三):慢查询开启与分析优化案例
android·adb
轩情吖12 小时前
MySQL Connect(2)
android·mysql·adb·workbench·mysql连接池·图形化mysql
我科绝伦(Huanhuan Zhou)1 天前
【生产案例】MySQL InnoDB 数据损坏崩溃修复
数据库·mysql·adb
mldlds1 天前
MySQL四种备份表的方式
mysql·adb·oracle