1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Android-specific, installs pre-built profilers."""
10 from telemetry import decorators
11 from telemetry.util import support_binaries
13 _DEVICE_PROFILER_DIR = '/data/local/tmp/profilers/'
16 def GetDevicePath(profiler_binary):
17 return os.path.join(_DEVICE_PROFILER_DIR, os.path.basename(profiler_binary))
21 def InstallOnDevice(device, profiler_binary):
22 host_path = support_binaries.FindPath(profiler_binary, 'android')
24 logging.error('Profiler binary "%s" not found. Could not be installed',
28 device_binary_path = GetDevicePath(profiler_binary)
29 device.PushChangedFiles(host_path, device_binary_path)
30 device.RunShellCommand('chmod 777 ' + device_binary_path)