getLastCommandOutput method

Future<String?> getLastCommandOutput()

Returns the log output of last executed command. Please note that disableRedirection() method also disables this functionality.

This method does not support executing multiple concurrent commands. If you execute multiple commands at the same time, this method will return output from all executions.

Implementation

Future<String?> getLastCommandOutput() async {
  try {
    var result = await _methodChannel.invokeMethod('getLastCommandOutput');
    return result['lastCommandOutput'];
  } on PlatformException catch (e, stack) {
    logger.e('Plugin getLastCommandOutput error: ${e.message}');
    return Future.error('getLastCommandOutput failed.', stack);
  }
}