Skip to content

Instantly share code, notes, and snippets.

@prongbang
Created May 13, 2023 13:38
Show Gist options
  • Save prongbang/4ab50a34f32d226a9b6ea6eb85bd3a11 to your computer and use it in GitHub Desktop.
Save prongbang/4ab50a34f32d226a9b6ea6eb85bd3a11 to your computer and use it in GitHub Desktop.
import 'dart:io';
void main() {
// Get the current platform.
final platform = Platform.isAndroid ? 'android' : 'ios';
// Disable remote desktop for the current platform.
if (platform == 'android') {
// Set the value of the "adb tcpip" command to 0.
Process.run('adb', ['tcpip', '0']);
} else if (platform == 'ios') {
// Set the value of the "defaults write" command to "NO".
Process.run('defaults', ['write', 'com.apple.RemoteDesktop', 'ARDAgentEnabled', 'NO']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment