1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

Merge pull request #8 from JaviMerino/fix_android_without_home

android: fix initialization without android
This commit is contained in:
setrofim 2015-12-15 17:46:32 +00:00
commit 485b4a62e3

View File

@ -383,13 +383,14 @@ def _initialize_with_android_home(env):
def _initialize_without_android_home(env): def _initialize_without_android_home(env):
if which('adb'): adb_full_path = which('adb')
if adb_full_path:
env.adb = 'adb' env.adb = 'adb'
else: else:
raise HostError('ANDROID_HOME is not set and adb is not in PATH. ' raise HostError('ANDROID_HOME is not set and adb is not in PATH. '
'Have you installed Android SDK?') 'Have you installed Android SDK?')
logger.debug('Discovering ANDROID_HOME from adb path.') logger.debug('Discovering ANDROID_HOME from adb path.')
env.platform_tools = os.path.dirname(env.adb) env.platform_tools = os.path.dirname(adb_full_path)
env.android_home = os.path.dirname(env.platform_tools) env.android_home = os.path.dirname(env.platform_tools)
_init_common(env) _init_common(env)
return env return env