Ejemplo n.º 1
0
def _initialize_without_android_home(env):
    if os.name == 'nt':
        raise HostError('Please set ANDROID_HOME to point to the location of the Android SDK.')
    # Assuming Unix in what follows.
    if subprocess.call('adb version >{}'.format(get_null()), shell=True):
        raise HostError('ANDROID_HOME is not set and adb is not in PATH. Have you installed Android SDK?')
    logger.debug('Discovering ANDROID_HOME from adb path.')
    env.platform_tools = os.path.dirname(subprocess.check_output('which adb', shell=True))
    env.android_home = os.path.dirname(env.platform_tools)
    _init_common(env)
    return env
Ejemplo n.º 2
0
 def validate(self):
     ret = os.system('{} > {} 2>&1'.format(self.run_benchmark_path, get_null()))
     if ret > 255:
         pass  # telemetry found and appears to be installed properly.
     elif ret == 127:
         raise WorkloadError('run_benchmark not found (did you specify correct run_benchmark_path?)')
     else:
         raise WorkloadError('Unexected error from run_benchmark: {}'.format(ret))
     if self.extract_fps and 'trace' not in self.run_benchmark_params:
         raise ConfigError('"trace" profiler must be enabled in order to extract FPS for Telemetry')
     self._resolve_run_benchmark_path()
def _initialize_without_android_home(env):
    if os.name == 'nt':
        raise HostError('Please set ANDROID_HOME to point to the location of the Android SDK.')
    # Assuming Unix in what follows.
    if subprocess.call('adb version >{}'.format(get_null()), shell=True):
        raise HostError('ANDROID_HOME is not set and adb is not in PATH. Have you installed Android SDK?')
    logger.debug('Discovering ANDROID_HOME from adb path.')
    env.platform_tools = os.path.dirname(subprocess.check_output('which adb', shell=True))
    env.android_home = os.path.dirname(env.platform_tools)
    _init_common(env)
    return env