// Top of ur .cs file ... using AndroidCtrl; using AndroidCtrl.ADB; using AndroidCtrl.ADB.Binary; //or using AndroidCtrl.ADB.Socket; using AndroidCtrl.Tools; ... ADB.Instance().Execute("version", int timeOut = 0); // or ADB.Instance().Execute("shell id", int timeOut = 0); // Shell cmd call ADB.Instance().ShellCmd("id", int timeOut = 0); // Shell cmd Su call ADB.Instance().Device.Su.ShellCmd("id", int timeOut = 0); // ShellCmd() and Su.ShellCmd() ...ShellCmd(string cmd, int timeout = 0) ...ShellCmd(string cmd, CancellationToken cancellationToken, int timeout = 0) ...ShellCmd(string cmd, ShellDataEventHandler shellDataEventHandler, int timeout = 0) ...ShellCmd(string cmd, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0) // ShellCmdHRes() and Su.ShellCmdHRes() ...ShellCmdHRes(string cmd, int timeout = 0) ...ShellCmdHRes(string cmd, CancellationToken cancellationToken, int timeout = 0) ...ShellCmdHRes(string cmd, ShellDataEventHandler shellDataEventHandler, int timeout = 0) ...ShellCmdHRes(string cmd, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0) // Creating an List<string> cmd stack List<string> stack = new List<string>() { "id", "id", "id" }; // Shell cmd stack call ADB.Instance().ShellCmdStack(stack, int timeOut = 0); // Shell cmd Su stack call ADB.Instance().Device.Su.ShellCmdStack(stack, int timeOut = 0); // ShellCmdStack() and Su.ShellCmdStack() ...ShellCmdStack(IEnumerablecmdStack, int timeout = 0) ...ShellCmdStack(IEnumerable cmdStack, CancellationToken cancellationToken, int timeout = 0) ...ShellCmdStack(IEnumerable cmdStack, ShellDataEventHandler shellDataEventHandler, int timeout = 0) ...ShellCmdStack(IEnumerable cmdStack, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0)
NOTE
timeout is by default -1 this implies infinite, but u can set also 250 for 250 milliseconds or an individual value. The timeout parameter is to tell my method how long it have to wait for an result before it ends. The return of ADB.Instance().Execute(), Fastboot.Instance().Execute() and Signer.Instance.Execute() are always a IEnumerable<string>.
(int timeout = 0, means that the class internal timeout parameter is used. This parameter is also by default -1)