anchor.diff:  ]
   ''';
   
  -        when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
  -            .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
  -        final List<String> errors = await xcdevice.getDiagnostics();
  -        expect(errors, hasLength(4));
  -        expect(errors[0], 'Error: iPhone is not paired with your computer. To use iPhone with Xcode, unlock it and choose to trust this computer when prompted. (code -9)');
  -        expect(errors[1], 'Error: iPhone is not paired with your computer.');
  -        expect(errors[2], 'Error: Xcode pairing error. (code -13)');
  -        expect(errors[3], 'Error: iPhone is busy: Preparing debugger support for iPhone. Xcode will continue when iPhone is finished. (code -10)');
  -      }, overrides: <Type, Generator>{
  -        Platform: () => macPlatform,
  +          fakeProcessManager.addCommand(const FakeCommand(
  +            command: <String>['xcrun', 'xcdevice', 'list', '--timeout', '2'],
  +            stdout: devicesOutput,
  +          ));
  +
  +          final List<String> errors = await xcdevice.getDiagnostics();
  +          expect(errors, hasLength(4));
  +          expect(errors[0], 'Error: iPhone is not paired with your computer. To use iPhone with Xcode, unlock it and choose to trust this computer when prompted. (code -9)');
  +          expect(errors[1], 'Error: iPhone is not paired with your computer.');
  +          expect(errors[2], 'Error: Xcode pairing error. (code -13)');
  +          expect(errors[3], 'Error: iPhone is busy: Preparing debugger support for iPhone. Xcode will continue when iPhone is finished. (code -10)');
  +          expect(fakeProcessManager.hasRemainingExpectations, isFalse);
  +        }, overrides: <Type, Generator>{
  +          Platform: () => macPlatform,
  +        });
         });
       });
     });
  
positive.code: ]
  ''';
  
          when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
              .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
          final List<IOSDevice> devices = await xcdevice.getAvailableTetheredIOSDevices();
          expect(devices, hasLength(3));
          expect(devices[0].id, 'd83d5bc53967baa0ee18626ba87b6254b2ab5418');
          expect(devices[0].name, 'An iPhone (Space Gray)');
          expect(await devices[0].sdkNameAndVersion, 'iOS 13.3');
          expect(devices[0].cpuArchitecture, DarwinArch.arm64);
          expect(devices[1].id, '98206e7a4afd4aedaff06e687594e089dede3c44');
          expect(devices[1].name, 'iPad 1');
          expect(await devices[1].sdkNameAndVersion, 'iOS 10.1');
          expect(devices[1].cpuArchitecture, DarwinArch.armv7);
          expect(devices[2].id, 'f577a7903cc54959be2e34bc4f7f80b7009efcf4');
          expect(devices[2].name, 'iPad 2');
          expect(await devices[2].sdkNameAndVersion, 'iOS 10.1');
          expect(devices[2].cpuArchitecture, DarwinArch.arm64); // Defaults to arm64 for unknown architecture.
        }, overrides: <Type, Generator>{
          Platform: () => macPlatform,
        });
  
        testWithoutContext('uses timeout', () async {
          when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
  
          when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
            .thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
  
          when(processManager.run(any))
            .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, '[]', '')));
          await xcdevice.getAvailableTetheredIOSDevices(timeout: const Duration(seconds: 20));
          verify(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '20'])).called(1);
        });
  
        testUsingContext('ignores "Preparing debugger support for iPhone" error', () async {
          when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
  
          when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
              .thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
  
          const String devicesOutput = '''
  [
    {
      "simulator" : false,
  
negative.code: ]
  ''';
  
            fakeProcessManager.addCommand(const FakeCommand(
              command: <String>['xcrun', 'xcdevice', 'list', '--timeout', '2'],
              stdout: devicesOutput,
            ));
  
            await xcdevice.getAvailableTetheredIOSDevices();
            final List<String> errors = await xcdevice.getDiagnostics();
            expect(errors, hasLength(1));
            expect(fakeProcessManager.hasRemainingExpectations, isFalse);
          }, overrides: <Type, Generator>{
            Platform: () => macPlatform,
          });
  
          testUsingContext('returns error message', () async {
            when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
            fakeProcessManager.addCommand(const FakeCommand(
              command: <String>['xcrun', '--find', 'xcdevice'],
              stdout: '/path/to/xcdevice',
            ));
  
            const String devicesOutput = '''
  [
     {
      "simulator" : false,
  