diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index b721a2ee3dd..b3a2538e12f 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -45,7 +45,6 @@ enum Artifact { iosDeploy, ideviceinfo, ideviceId, - idevicename, idevicesyslog, idevicescreenshot, ideviceinstaller, @@ -113,8 +112,6 @@ String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMo return 'ideviceinfo'; case Artifact.ideviceId: return 'idevice_id'; - case Artifact.idevicename: - return 'idevicename'; case Artifact.idevicesyslog: return 'idevicesyslog'; case Artifact.idevicescreenshot: @@ -263,7 +260,6 @@ class CachedArtifacts extends Artifacts { case Artifact.ideviceinfo: case Artifact.idevicescreenshot: case Artifact.idevicesyslog: - case Artifact.idevicename: final String artifactFileName = _artifactToFileName(artifact); return _cache.getArtifactDirectory('libimobiledevice').childFile(artifactFileName).path; case Artifact.iosDeploy: @@ -515,7 +511,6 @@ class LocalEngineArtifacts extends Artifacts { return _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', artifactFileName); case Artifact.ideviceId: case Artifact.ideviceinfo: - case Artifact.idevicename: case Artifact.idevicescreenshot: case Artifact.idevicesyslog: return _cache.getArtifactDirectory('libimobiledevice').childFile(artifactFileName).path; diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 467aaf50dad..dec7a4ec3c6 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -89,13 +89,11 @@ class IMobileDevice { IMobileDevice() : _ideviceIdPath = globals.artifacts.getArtifactPath(Artifact.ideviceId, platform: TargetPlatform.ios), _ideviceinfoPath = globals.artifacts.getArtifactPath(Artifact.ideviceinfo, platform: TargetPlatform.ios), - _idevicenamePath = globals.artifacts.getArtifactPath(Artifact.idevicename, platform: TargetPlatform.ios), _idevicesyslogPath = globals.artifacts.getArtifactPath(Artifact.idevicesyslog, platform: TargetPlatform.ios), _idevicescreenshotPath = globals.artifacts.getArtifactPath(Artifact.idevicescreenshot, platform: TargetPlatform.ios); final String _ideviceIdPath; final String _ideviceinfoPath; - final String _idevicenamePath; final String _idevicesyslogPath; final String _idevicescreenshotPath; @@ -113,56 +111,6 @@ class IMobileDevice { } bool _isInstalled; - /// Returns true if libimobiledevice is installed and working as expected. - /// - /// Older releases of libimobiledevice fail to work with iOS 10.3 and above. - Future get isWorking async { - if (_isWorking != null) { - return _isWorking; - } - if (!isInstalled) { - _isWorking = false; - return _isWorking; - } - // If usage info is printed in a hyphenated id, we need to update. - const String fakeIphoneId = '00008020-001C2D903C42002E'; - final Map executionEnv = Map.fromEntries( - >[globals.cache.dyLdLibEntry] - ); - final ProcessResult ideviceResult = (await processUtils.run( - [ - _ideviceinfoPath, - '-u', - fakeIphoneId, - ], - environment: executionEnv, - )).processResult; - if ((ideviceResult.stdout as String).contains('Usage: ideviceinfo')) { - _isWorking = false; - return _isWorking; - } - - // If no device is attached, we're unable to detect any problems. Assume all is well. - final ProcessResult result = (await processUtils.run( - [ - _ideviceIdPath, - '-l', - ], - environment: executionEnv, - )).processResult; - if (result.exitCode == 0 && (result.stdout as String).isEmpty) { - _isWorking = true; - } else { - // Check that we can look up the names of any attached devices. - _isWorking = await processUtils.exitsHappy( - [_idevicenamePath], - environment: executionEnv, - ); - } - return _isWorking; - } - bool _isWorking; - Future getAvailableDeviceIDs() async { try { final ProcessResult result = await globals.processManager.run( diff --git a/packages/flutter_tools/test/general.shard/ios/mac_test.dart b/packages/flutter_tools/test/general.shard/ios/mac_test.dart index 7cea841e3f6..f79208cbeb9 100644 --- a/packages/flutter_tools/test/general.shard/ios/mac_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/mac_test.dart @@ -56,16 +56,6 @@ void main() { ); }); - testUsingContext('isWorking returns false if libimobiledevice is not installed', () async { - when(mockProcessManager.runSync( - [ideviceIdPath, '-h'], environment: anyNamed('environment'), - )).thenReturn(ProcessResult(123, 1, '', '')); - expect(await globals.iMobileDevice.isWorking, false); - }, overrides: { - ProcessManager: () => mockProcessManager, - Artifacts: () => mockArtifacts, - }); - testUsingContext('getAvailableDeviceIDs throws ToolExit when libimobiledevice is not installed', () async { when(mockProcessManager.run( [ideviceIdPath, '-l'],