parameters: (self)
return_statement: return ret
docstring: Start adb server.
docstring_summary: Start adb server.
docstring_tokens: Start adb server .
function: def StartAdbServer(self):
      """Start adb server."""
      adb_cmd = ['taskset', '-c', '0', constants.GetAdbPath(), 'start-server']
      ret, _ = cmd_helper.GetCmdStatusAndOutput(adb_cmd)
      retry = 0
      while retry < 3:
        ret, _ = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb'])
        if ret == 0:
          # pgrep found adb, start-server succeeded.
          # Waiting for device to reconnect before returning success.
          self._adb.SendCommand('wait-for-device')
          return 0
        retry += 1
        time.sleep(retry)
      return ret
function_tokens: def StartAdbServer ( self ) : adb_cmd = [ 'taskset' , '-c' , '0' , constants . GetAdbPath ( ) , 'start-server' ] ret , _ = cmd_helper . GetCmdStatusAndOutput ( adb_cmd ) retry = 0 while retry < 3 : ret , _ = cmd_helper . GetCmdStatusAndOutput ( [ 'pgrep' , 'adb' ] ) if ret == 0 : # pgrep found adb, start-server succeeded. # Waiting for device to reconnect before returning success. self . _adb . SendCommand ( 'wait-for-device' ) return 0 retry += 1 time . sleep ( retry ) return ret