示例#1
0
        internal Task StartEmulator(string name, string logfile, CancellationToken cancellationToken)
        {
            var args      = string.Format("@{0} > {1} 2>&1 &", name, logfile);
            var shellArgs = string.Format("-c \"{0} {1}\"", EmulatorTool, args);

            return(ProcessHelper.RunCommand("/bin/sh", shellArgs, cancellationToken));
        }
示例#2
0
        internal Task CreateAvd(bool replace, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var args = new StringBuilder();

            args.Append("-v ");
            args.AppendFormat("create avd -n {0} -t {1}", Device.Name, Device.Target);
            if (!string.IsNullOrEmpty(Device.Abi))
            {
                args.AppendFormat(" --abi {0}", Device.Abi);
            }
            if (!string.IsNullOrEmpty(Device.Device))
            {
                args.AppendFormat(" --device \"{0}\"", Device.Device);
            }
            if (replace)
            {
                args.Append("  --force");
            }

            return(ProcessHelper.RunCommand(AndroidTool, args.ToString(), cancellationToken));
        }
示例#3
0
        internal Task ClearLogCat(CancellationToken cancellationToken)
        {
            var args = AdbCommandLine("logcat -c");

            return(ProcessHelper.RunCommand(Adb, args, cancellationToken));
        }
示例#4
0
        internal Task InstallApk(string apk, CancellationToken cancellationToken)
        {
            var args = AdbCommandLine($"install -r -d {apk}");

            return(ProcessHelper.RunCommand(Adb, args, cancellationToken));
        }
示例#5
0
 internal Task ClearLogCat(CancellationToken cancellationToken)
 {
     return(ProcessHelper.RunCommand(Adb, "logcat -c", cancellationToken));
 }
示例#6
0
        internal Task InstallApk(string apk, CancellationToken cancellationToken)
        {
            var args = string.Format("install -r -d {0}", apk);

            return(ProcessHelper.RunCommand(Adb, args, cancellationToken));
        }