Quote:
Originally Posted by sogaiu
Also working on skipping lines that are before the time that the script started executing. Going to assume that the device's time and the host's time are close. Looks like adb logcat output doesn't contain year info...
|
You don't need that, just use that "-T1" as I mentioned above: you will only dump one past line, instead of the whole history. The "Popen" string becomes:
process = subprocess.Popen(['adb', 'logcat', '-T1', 'OnyxMonitEv:I *:S'], stdout=subprocess.PIPE)
EDIT: should you wish to accept your mission, the script should, at the begnning, check the screen resolution. Because those hardcoded values in
Code:
x = int(m.group("x"))*2104/2200
y = int(m.group("y"))*1560/1650
Should go into variables.
The other two values, the tablet resolution, could be taken with another adb command (maybe an `adb shell getprop [...]`
EDIT: more exactly,
`adb shell getprop ro.product.board` returns '
Max2'.
You can use a switch on that output to impose that tablet_res_w = 2200 and tablet_res_h = 1650.
With the Note, which will get another value as "ro.product.board", the conditional will acquire another branch towards values tablet_res_w = 1872 and tablet_res_h = 1404.