fix: use /system/bin/sh for chmod to fix iperf3 binary permission on Android
CI / Analyze & Test (push) Failing after 31s
CI / Analyze & Test (push) Failing after 31s
- The original chmod call used Process.run('chmod', ...) which fails on Android
because chmod is not available in the app sandbox PATH
- /system/bin/sh is always present on Android and can execute chmod on the
extracted binary, setting executable permissions before the first run
This commit is contained in:
@@ -30,8 +30,11 @@ class Iperf3BinaryPathProvider {
|
||||
final file = File('${binaryDir.path}/iperf3');
|
||||
await file.writeAsBytes(bytes.buffer.asUint8List());
|
||||
|
||||
// chmod +x the binary
|
||||
await Process.run('chmod', ['+x', file.path]);
|
||||
// chmod +x the binary — /system/bin/sh is always present on Android
|
||||
await Process.run(
|
||||
'/system/bin/sh',
|
||||
['-c', 'chmod +x "\$1"', '_', file.path],
|
||||
);
|
||||
|
||||
_cachedPath = file.path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user