Unverified Commit 4dc1bd40 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Handle updated error message when iOS device is locked (#108057)

parent 201be6bd
......@@ -22,6 +22,7 @@ import 'iproxy.dart';
const String noProvisioningProfileErrorOne = 'Error 0xe8008015';
const String noProvisioningProfileErrorTwo = 'Error 0xe8000067';
const String deviceLockedError = 'e80000e2';
const String deviceLockedErrorMessage = 'the device was not, or could not be, unlocked';
const String unknownAppLaunchError = 'Error 0xe8000022';
class IOSDeploy {
......@@ -520,7 +521,7 @@ String _monitorIOSDeployFailure(String stdout, Logger logger) {
logger.printError(noProvisioningProfileInstruction, emphasis: true);
// Launch issues.
} else if (stdout.contains(deviceLockedError)) {
} else if (stdout.contains(deviceLockedError) || stdout.contains(deviceLockedErrorMessage)) {
logger.printError('''
═══════════════════════════════════════════════════════════════════════════════════
Your device is locked. Unlock your device first before running.
......
......@@ -258,7 +258,7 @@ void main () {
expect(logger.errorText, contains('No Provisioning Profile was found'));
});
testWithoutContext('device locked', () async {
testWithoutContext('device locked code', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
......@@ -273,6 +273,21 @@ void main () {
expect(logger.errorText, contains('Your device is locked.'));
});
testWithoutContext('device locked message', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: '[ +95 ms] error: The operation couldn’t be completed. Unable to launch io.flutter.examples.gallery because the device was not, or could not be, unlocked.',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('Your device is locked.'));
});
testWithoutContext('unknown app launch error', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment