Adb with python operation to achieve the dream of home and country Automatic brush goods

Adb with python operation to achieve the dream of home and country Automatic brush goods

principle

Here Insert Picture Description
As shown, first determine the coordinates of the three and nine store goods in the screen, and then drag to achieve the goods to the store operation by adb. That is, do two nested loops, the first of three cargo do loop that let the goods inside the shop in order to do nine cycles.

Code

import os
from time import sleep
from PIL import Image
from numpy import square,sqrt

%九个店的坐标
tar1 = [284,735]
tar2 = [553,620]
tar3 = [808,490]
tar4 = [294,1003]
tar5 = [539,880]
tar6 = [801,767]
tar7 = [294,1248]
tar8 = [549,1122]
tar9 = [798,1003]

tar = [tar1,tar2,tar3,tar4,tar5,tar6,tar7,tar8,tar9]

%三个货物坐标
car1 = [666,1639]
car2 = [815,1570]
car3 = [947,1497]

car = [car1,car2,car3]

while(1):
    
    for i in range(3):
        for j in range(9):

            os.system('adb shell input swipe %d %d %d %d 200'%(car[i][0],car[i][1],tar[j][0],tar[j][1]))





Released three original articles · won praise 8 · views 809

Guess you like

Origin blog.csdn.net/qq_38679612/article/details/103175151