Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_tools] remove iOS screenshot on failure functionality #68650

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 0 additions & 20 deletions packages/flutter_tools/lib/src/ios/devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:vm_service/vm_service.dart' as vm_service;

import '../application_package.dart';
import '../base/common.dart';
import '../base/error_handling_io.dart';
import '../base/file_system.dart';
import '../base/io.dart';
import '../base/logger.dart';
Expand Down Expand Up @@ -440,7 +439,6 @@ class IOSDevice extends Device {
installationResult = await iosDeployDebugger.launchAndAttach() ? 0 : 1;
}
if (installationResult != 0) {
await _screenshotOnFailure();
_logger.printError('Could not run ${bundle.path} on $id.');
_logger.printError('Try launching Xcode and selecting "Product > Run" to fix the problem:');
_logger.printError(' open ios/Runner.xcworkspace');
Expand Down Expand Up @@ -470,7 +468,6 @@ class IOSDevice extends Device {
packageName: FlutterProject.current().manifest.appName,
);
if (localUri == null) {
await _screenshotOnFailure();
iosDeployDebugger?.detach();
return LaunchResult.failed();
}
Expand Down Expand Up @@ -559,23 +556,6 @@ class IOSDevice extends Device {
});
await _portForwarder?.dispose();
}

Future<void> _screenshotOnFailure() async {
final bool screenshotOnConnectionFailure = _platform
.environment['FLUTTER_IOS_SCREENSHOT_ON_CONNECTION_FAILURE'] == 'true';
if (!screenshotOnConnectionFailure) {
return;
}
final File file = _fileSystem.file('test_screenshot.png');
try {
await takeScreenshot(file);
_logger.printStatus('BASE64 SCREENSHOT:${base64.encode(file.readAsBytesSync())}');
} on Exception {
_logger.printError('Failed to take screenshot');
} finally {
ErrorHandlingFileSystem.deleteIfExists(file);
}
}
}

/// Decodes a vis-encoded syslog string to a UTF-8 representation.
Expand Down