code: def clear_adb_log(self):
          
          try:
              self._ad.adb.logcat('-c')
          except adb.AdbError as e:
              # On Android O, the clear command fails due to a known bug.
              # Catching this so we don't crash from this Android issue.
              if b'failed to clear' in e.stderr:
                  self._ad.log.warning(
                      'Encountered known Android error to clear logcat.')
              else:
                  raise
docs: Clears cached adb content.