stopApp static method

Future<ProcessResult> stopApp({
  1. required String package,
  2. String? serialno,
  3. required String cmd,
})

Implementation

static Future<ProcessResult> stopApp(
    {required String package, String? serialno, required String cmd}) async {
  final result = await Process.run(
      cmd,
      [
        if (serialno != null) '-s',
        if (serialno != null) serialno,
        'shell',
        'am',
        'force-stop',
        package
      ],
      runInShell: true);
  return result;
}