**
adb快速撰寫bat腳本,對安卓手機內釘釘,操作上下班打卡,
解決的你每天遲到早退“大煩惱”,

**
adb connect 192.168.10.155
#WiFi連接手機
adb devices
#查看adb連接手機設備
adb shell input keyevent 224
#點亮螢屏
adb shell input swipe 300 1000 300 500
#滑動螢屏解鎖
adb shell am start -n com.alibaba.android.rimet/com.alibaba.android.rimet.biz.LaunchHomeActivity
#找到釘釘應用,并打開,
TIMEOUT /T 3
adb shell input tap 360 1350
#進入釘釘后,點擊壹品倉
TIMEOUT /T 3
#點擊后等待3秒
adb shell input tap 500 1050
#點擊【考勤打卡】
TIMEOUT /T 3
adb shell input tap 360 800
#點擊【上班打卡,下班打卡】
TIMEOUT /T 3
adb shell input keyevent 26
#關閉手機螢屏,
基于上面代碼現做出以下優化!
adb connect 192.168.10.155
#WiFi連接手機
adb devices
#查看adb連接手機設備
adb shell input keyevent 224
#點亮螢屏
adb shell input swipe 300 1000 300 500
#滑動螢屏解鎖
adb shell am start -n com.alibaba.android.rimet/com.alibaba.android.rimet.biz.LaunchHomeActivity
#找到釘釘應用,并打開,
TIMEOUT /T 2
adb shell input tap 360 1350
#進入釘釘后,點擊:【壹品倉】
TIMEOUT /T 2
adb shell input tap 500 1050
#點擊【考勤打卡】
TIMEOUT /T 2
adb shell input tap 360 800
#點擊【上班打卡,下班打卡】
TIMEOUT /T 2
adb shell screencap -p /sdcard/01.png
#截圖成功打卡圖片到電腦
adb pull /sdcard/01.png
TIMEOUT /T 1
#截圖匯入電腦
adb shell input keyevent 3
#回傳首頁
TIMEOUT /T 1
adb shell input tap 510 1450
#查看后臺應用
adb shell input swipe 360 1100 400 300
#殺掉應用
adb shell input keyevent 26
#關閉手機螢屏,
01.png
#打開截圖圖片,確認是否成功打卡!
exit
注:本人此次測驗手機為HUAWEI_P20_PRO,未能適配其他機型,需手動獲取【指標元素】稍微修改即可,完美使用!

具體操作中,有疑問,可以加我微信,
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/272010.html
標籤:其他
下一篇:Flutter學習第十五天:2021年最新版超詳細Flutter實作Mob+SMSSDK手機驗證碼登錄實作,Android和Flutter混合開發?
