Skip to content

Commit 7e9ff41

Browse files
committed
dump on android pie dtmilano#257
- Overwrite dump file before invoking `uiautomator`
1 parent c969a29 commit 7e9ff41

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/com/dtmilano/android/viewclient.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@author: Diego Torres Milano
1919
'''
2020

21-
__version__ = '15.8.0'
21+
__version__ = '15.8.1'
2222

2323
import sys
2424
import warnings
@@ -3273,7 +3273,9 @@ def dump(self, window=-1, sleep=1):
32733273
else:
32743274
pathname = '/sdcard'
32753275
filename = 'window_dump.xml'
3276-
cmd = 'uiautomator dump %s %s/%s >/dev/null && cat %s/%s' % ('--compressed' if self.compressedDump else '', pathname, filename, pathname, filename)
3276+
cmd = 'cp /dev/null {pathname}/{filename} && uiautomator dump {compressed} {pathname}/{filename} >/dev/null && cat {pathname}/{filename}'.format(
3277+
pathname = pathname, filename = filename,
3278+
compressed = '--compressed' if self.compressedDump else '')
32773279
elif api == 23:
32783280
# In API 23 the process' stdout,in and err are connected to the socket not to the pts as in
32793281
# previous versions, so we can't redirect to /dev/tty

0 commit comments

Comments
 (0)