anchor.diff:  ]
   ''';
   
  -        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(1));
  -        expect(devices[0].id, '43ad2fda7991b34fe1acbda82f9e2fd3d6ddc9f7');
  -      }, overrides: <Type, Generator>{
  -        Platform: () => macPlatform,
  -      });
  -
  -      testUsingContext('handles unknown architectures', () async {
  -        when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
  -
  -        when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
  -          .thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
  -
  -        const String devicesOutput = '''
  +          fakeProcessManager.addCommand(const FakeCommand(
  +            command: <String>['xcrun', 'xcdevice', 'list', '--timeout', '2'],
  +            stdout: devicesOutput,
  +          ));
  +          final List<IOSDevice> devices = await xcdevice.getAvailableTetheredIOSDevices();
  +          expect(devices, hasLength(1));
  +          expect(devices[0].id, '43ad2fda7991b34fe1acbda82f9e2fd3d6ddc9f7');
  +          expect(fakeProcessManager.hasRemainingExpectations, isFalse);
  +        }, overrides: <Type, Generator>{
  +          Platform: () => macPlatform,
  +        });
  +
  +        testUsingContext('handles unknown architectures', () async {
  +          when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
  +          fakeProcessManager.addCommand(const FakeCommand(
  +            command: <String>['xcrun', '--find', 'xcdevice'],
  +            stdout: '/path/to/xcdevice',
  +          ));
  +
  +          const String devicesOutput = '''
   [
     {
       "simulator" : false,
  
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[0].cpuArchitecture, DarwinArch.armv7);
          expect(devices[1].cpuArchitecture, DarwinArch.arm64);
        }, overrides: <Type, Generator>{
          Platform: () => macPlatform,
        });
      });
  
      group('diagnostics', () {
        final FakePlatform macPlatform = FakePlatform(operatingSystem: 'macos');
  
        testWithoutContext('Xcode not installed', () async {
          when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(false);
  
          expect(await xcdevice.getDiagnostics(), isEmpty);
          verifyNever(processManager.run(any));
        });
  
        testWithoutContext('xcdevice fails', () async {
          when(mockXcode.isInstalledAndMeetsVersionCheck).thenReturn(true);
  
          when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
              .thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
  
          when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
              .thenThrow(const ProcessException('xcrun', <String>['xcdevice', 'list', '--timeout', '2']));
  
          expect(await xcdevice.getDiagnostics(), isEmpty);
        });
  
        testUsingContext('uses cache', () 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,
            ));
  
            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,
          });
        });
      });
    });
  