def if_device_path_exists(device_serial, device_path)
      return if run_adb_command("adb -s #{device_serial} shell ls #{device_path}",
                                print_all: false,
                                print_command: false).include?('No such file')

      yield(device_path)
    rescue
      # Some versions of ADB will have a non-zero exit status for this, which will cause the executor to raise.
      # We can safely ignore that and treat it as if it returned 'No such file'
    end
def if_device_path_exists(device_serial, device_path)
      return if run_adb_command("adb -s #{device_serial} shell ls #{device_path}",
                                print_all: false,
                                print_command: false).include?('No such file')

      yield(device_path)
    rescue
      # Some versions of ADB will have a non-zero exit status for this, which will cause the executor to raise.
      # We can safely ignore that and treat it as if it returned 'No such file'
    end
Some device commands fail if executed against a device path that does not exist, so this helper method
 provides a way to conditionally execute a block only if the provided path exists on the device.