109 """Capture an SKP."""
110 remote_path =
'/data/data/%s/cache/%s' % (package, os.path.basename(skp_file))
117 adb_shell(
'setprop debug.hwui.capture_frame_as_skp %s' % remote_path)
122 device.drag((300, 300), (300, 350), 1, 10)
124 if time.time() - start > timeout:
125 raise Exception(
'Timed out waiting for SKP capture.')
129 cmd = [
'adb',
'pull', remote_path, skp_file]
133 adb_shell(
'setprop debug.hwui.capture_frame_as_skp ""')
148 """Capture SKPs for all apps."""
149 device = MonkeyRunner.waitForConnection()
153 device.drag((600, 600), (10, 10), 0.2, 10)
155 apps_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'apps')
156 app_files = [os.path.join(apps_dir, app)
for app
in os.listdir(apps_dir)]
158 for app_file
in app_files:
161 print(
' Package %s' % app.package)
163 print(
' Launched activity %s' % app.activity)
165 for action
in app.actions:
166 print(
' %s' % action.__class__.__name__)
169 time.sleep(WAIT_FOR_SKP_CAPTURE)
170 print(
' Capturing SKP.')
171 skp_file =
'%s.skp' % app.name
173 print(
' Wrote SKP to %s' % skp_file)