def builtin_adb_path(): """ Return built-in adb executable path Returns: adb executable path """ system = platform.system() machine = platform.machine() adb_path = DEFAULT_ADB_PATH.get('{}-{}'.format(system, machine)) if not adb_path: adb_path = DEFAULT_ADB_PATH.get(system) if not adb_path: raise RuntimeError( "No adb executable supports this platform({}-{}).".format( system, machine)) # overwrite uiautomator adb if "ANDROID_HOME" in os.environ: del os.environ["ANDROID_HOME"] if system != "Windows": # chmod +x adb make_file_executable(adb_path) return adb_path
def builtin_adb_path(): """ Return built-in adb executable path Returns: adb executable path """ system = platform.system() machine = platform.machine() adb_path = DEFAULT_ADB_PATH.get('{}-{}'.format(system, machine)) if adb_path: LOGGING.debug('system DEFAULT_ADB_PATH: %s' % adb_path) if not adb_path: adb_path = DEFAULT_ADB_PATH.get(system) LOGGING.debug('set adb_path: %s' % adb_path) if not adb_path: raise RuntimeError( "No adb executable supports this platform({}-{}).".format( system, machine)) # overwrite uiautomator adb if "ANDROID_HOME" in os.environ: del os.environ["ANDROID_HOME"] return adb_path
def builtin_adb_path(self): system = platform.system() machine = platform.machine() adb_path = DEFAULT_ADB_PATH.get('{}-{}'.format(system, machine)) if not adb_path: adb_path = DEFAULT_ADB_PATH.get(system) if not adb_path: raise RuntimeError( "No adb executable supports this platform({}-{}).".format( system, machine)) # overwrite uiautomator adb if "ANDROID_HOME" in os.environ: del os.environ["ANDROID_HOME"] return adb_path