def getADB(TOOLSDIR):
 try:
  if ((len(settings.ADB_BINARY) > 0) and isFileExists(settings.ADB_BINARY)):
   return settings.ADB_BINARY
  else:
   adb = 'adb'
   if (platform.system() == 'Darwin'):
    adb_dir = os.path.join(TOOLSDIR, 'adb/mac/')
    subprocess.call(['chmod', '777', adb_dir])
    adb = os.path.join(TOOLSDIR, 'adb/mac/adb')
   elif (platform.system() == 'Linux'):
    adb_dir = os.path.join(TOOLSDIR, 'adb/linux/')
    subprocess.call(['chmod', '777', adb_dir])
    adb = os.path.join(TOOLSDIR, 'adb/linux/adb')
   elif (platform.system() == 'Windows'):
    adb = os.path.join(TOOLSDIR, 'adb/windows/adb.exe')
   return adb
 except:
  PrintException('[ERROR] Getting ADB Location')
  return 'adb'

def getADB ( TOOLSDIR ) : try : if ( ( len ( settings . ADB_BINARY ) > 0 ) and isFileExists ( settings . ADB_BINARY ) ) : return settings . ADB_BINARY else : adb = 'adb' if ( platform . system ( ) == 'Darwin' ) : adb_dir = os . path . join ( TOOLSDIR , 'adb/mac/' ) subprocess . call ( [ 'chmod' , '777' , adb_dir ] ) adb = os . path . join ( TOOLSDIR , 'adb/mac/adb' ) elif ( platform . system ( ) == 'Linux' ) : adb_dir = os . path . join ( TOOLSDIR , 'adb/linux/' ) subprocess . call ( [ 'chmod' , '777' , adb_dir ] ) adb = os . path . join ( TOOLSDIR , 'adb/linux/adb' ) elif ( platform . system ( ) == 'Windows' ) : adb = os . path . join ( TOOLSDIR , 'adb/windows/adb.exe' ) return adb except : PrintException ( '[ERROR] Getting ADB Location' ) return 'adb'
get adb binary path .