예제 #1
0
        private static ADBResult ADBShell(string args, bool su = false)
        {
            var result = new ADBResult();

            using (Process process = new Process())
            {
                process.StartInfo           = psi;
                process.StartInfo.Arguments = $"shell {(su ? "su -c " : "")}\"{args}\"";
                process.Start();
                result.stdout = new StringReader(process.StandardOutput.ReadToEnd());
                result.stderr = new StringReader(process.StandardError.ReadToEnd());
                process.WaitForExit(30000);
            }
            return(result);
        }
예제 #2
0
        private static ADBResult ADB(string args)
        {
            var result = new ADBResult();

            using (Process process = new Process())
            {
                process.StartInfo           = psi;
                process.StartInfo.Arguments = args;
                process.Start();
                result.stdout = new StringReader(process.StandardOutput.ReadToEnd());
                result.stderr = new StringReader(process.StandardError.ReadToEnd());
                process.WaitForExit(30000);
            }
            return(result);
        }