public void WaitFor(AdbTransport transport = AdbTransport.Any, AdbState state = AdbState.Device, AdbToolSettings settings = null)
        {
            if (settings == null)
            {
                settings = new AdbToolSettings();
            }

            // adb wait-for[-<transport>]-<state>
            //  transport: usb, local, or any (default)
            //  state: device, recovery, sideload, bootloader
            var builder = new ProcessArgumentBuilder();

            AddSerial(settings.Serial, builder);

            var x = "wait-for";

            if (transport == AdbTransport.Local)
            {
                x = "-local";
            }
            else if (transport == AdbTransport.Usb)
            {
                x = "-usb";
            }

            switch (state)
            {
            case AdbState.Bootloader:
                x += "-bootloader";
                break;

            case AdbState.Device:
                x += "-device";
                break;

            case AdbState.Recovery:
                x += "-recovery";
                break;

            case AdbState.Sideload:
                x += "-sideload";
                break;
            }

            builder.Append(x);

            Run(settings, builder);
        }
Ejemplo n.º 2
0
        public void WaitFor(AdbTransport transport = AdbTransport.Any, AdbState state = AdbState.Device, string adbSerial = null)
        {
            // adb wait-for[-<transport>]-<state>
            //  transport: usb, local, or any (default)
            //  state: device, recovery, sideload, bootloader
            var builder = new ProcessArgumentBuilder();

            runner.AddSerial(adbSerial, builder);

            var x = "wait-for";

            if (transport == AdbTransport.Local)
            {
                x = "-local";
            }
            else if (transport == AdbTransport.Usb)
            {
                x = "-usb";
            }

            switch (state)
            {
            case AdbState.Bootloader:
                x += "-bootloader";
                break;

            case AdbState.Device:
                x += "-device";
                break;

            case AdbState.Recovery:
                x += "-recovery";
                break;

            case AdbState.Sideload:
                x += "-sideload";
                break;
            }

            builder.Append(x);

            runner.RunAdb(AndroidSdkHome, builder);
        }
Ejemplo n.º 3
0
        public static void AdbWaitFor(this ICakeContext context, AdbTransport transport = AdbTransport.Any, AdbState state = AdbState.Device, AdbToolSettings settings = null)
        {
            var t = GetAdbTool(context);

            t.WaitFor(transport, state, settings);
        }