1

Rather than using a drag or swipe command in the android debug bridge or AndroidViewClient like this:

device.drag((600,800),(600,1200), 1000) 
device.shell('input touchscreen swipe 600 800 600 1200 1000') 

Is there some way to simulate something like the following?

1. press down on some coordinates (eventType=DOWN)
2. sleep 2 seconds (i.e. keep holding there)
3. move to some other coordinates
2. sleep 2 seconds (i.e. keep holding there)
5. release (eventType=UP)

Basically, you touch, hold there for a few seconds, drag and keep holding there for a few seconds, then release the pad.

Micro
  • 10,303
  • 14
  • 82
  • 120

1 Answers1

0

If you take a look at AdbClient.longPress() you will see how the long press event is sent for some keys:

    if name in KEY_MAP:
        self.shell('sendevent %s 1 %d 1' % (dev, KEY_MAP[name]))
        self.shell('sendevent %s 0 0 0' % dev)
        time.sleep(duration)
        self.shell('sendevent %s 1 %d 0' % (dev, KEY_MAP[name]))
        self.shell('sendevent %s 0 0 0' % dev)

You can do something similar for your case. To get an idea of what you should write, do the same set of events you mentioned and analyze them using getevent.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134