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

相关推荐
韩zj8 小时前
服务器定时备份数据库脚本
服务器·数据库·adb
云和数据.ChenGuang9 小时前
OpenEuler 系统中安装 MySQL
运维·数据库·mysql·adb·运维工程师·运维技术
maycho1231 天前
机械臂工作空间仿真分析-基于蒙特卡洛法的七自由度机械臂
adb
qq_366336371 天前
mysql-5.7.38-winx64.zip 启动教程(免安装版)
数据库·mysql·adb
loosed2 天前
Ubuntu mysql8 tar.xz 安装
linux·ubuntu·adb
坐吃山猪2 天前
AutoGLMPhone05-源码-ADB模块
adb
菜择贰2 天前
ubantu下载mysql
数据库·mysql·adb
坐吃山猪2 天前
AutoGLMPhone03-adb模块
adb·llm·glm
今晚务必早点睡2 天前
MySQL 新手避坑指南:安装、区分、检查一步到位
数据库·mysql·adb
我的offer在哪里3 天前
mysql修改密码
adb