Repository navigation
Use devicectl for screenshots on Xcode 27, remove idevicescreenshot artifact - #189091
Conversation
d635b7e to
c5a5934
Compare
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for taking screenshots on iOS CoreDevices using devicectl when Xcode 26 or higher is installed, falling back to iMobileDevice for older versions. Feedback points out a potential TypeError when casting the decoded JSON response directly to a map, and a mismatch between the error message thrown in IOSDevice.takeScreenshot and the expected message in the unit tests.
There was a problem hiding this comment.
Code Review
This pull request introduces screenshot support for iOS CoreDevices by utilizing the devicectl command-line tool. The feedback correctly points out that devicectl screenshot capabilities are only available starting with Xcode 27, so the checks for Xcode major version 26 or higher in the device and test files must be updated to 27 to prevent failures on Xcode 26. Additionally, the new public getter isDevicectlInstalled requires a documentation comment to comply with the repository style guide.
There was a problem hiding this comment.
Code Review
This pull request replaces the deprecated idevicescreenshot tool with devicectl for capturing screenshots on iOS CoreDevices when running Xcode 16 or higher. It removes idevicescreenshot from the cache and artifacts, and integrates the new devicectl command into IOSCoreDeviceControl and IOSDevice. The review feedback highlights a critical typo where Xcode version 27 was specified instead of 16 across implementation and test files, which would disable screenshots for Xcode 16 users. Additionally, the reviewer noted that the new public getter isDevicectlInstalled requires a documentation comment to comply with the repository's style guide.
| ); | ||
| } on Exception catch (error) { | ||
| final errorMessage = error.toString(); | ||
| if (errorMessage.contains('CoreDeviceError error 4000') || |
There was a problem hiding this comment.
I hit these when my device was either unpaired, or it was wireless paired and was locked.
0e6c375 to
436e874
Compare
…12406) Manual roll Flutter from e52f01c920ad to b766512c65d8 (42 revisions) Manual roll requested by stuartmorgan@google.com flutter/flutter@e52f01c...b766512 2026-08-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 2a799a2404e9 to 9859c0a39adb (4 revisions) (flutter/flutter#190521) 2026-08-04 154381524+flutteractionsbot@users.noreply.github.com Revert: iOS: Eliminate use of IOSContextNoop in platform view tests (flutter/flutter#190501) 2026-08-04 125822178+guszxtavo@users.noreply.github.com [Impeller] Enable ETC2/ASTC LDR/BC texture compression features at Vulkan device creation (flutter/flutter#189303) 2026-08-03 30870216+gaaclarke@users.noreply.github.com Remove openglessdf from impeller_unittests. (flutter/flutter#190469) 2026-08-03 1961493+harryterkelsen@users.noreply.github.com [web] Unify image decoding and codecs on CanvasKit and Skwasm (flutter/flutter#188573) 2026-08-03 chris@bracken.jp iOS: Eliminate use of IOSContextNoop in platform view tests (flutter/flutter#190419) 2026-08-03 evanwall@buffalo.edu Add path rendering benchmarks (flutter/flutter#188654) 2026-08-03 97480502+b-luk@users.noreply.github.com Add windows platform support for primitive_shape_test integration test (flutter/flutter#190464) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from 958c1c1921a1 to a08d918ebd6a (3 revisions) (flutter/flutter#190467) 2026-08-03 chris@bracken.jp tests: add --ios-runtime param (flutter/flutter#190414) 2026-08-03 chris@bracken.jp iOS: Remove the synchronous first-frame wait (flutter/flutter#190432) 2026-08-03 chris@bracken.jp iOS: Eliminate the Impeller/Skia backend selection params (flutter/flutter#190416) 2026-08-03 chris@bracken.jp iOS,macOS: Use @autoclosure in Logger (flutter/flutter#190417) 2026-08-03 chris@bracken.jp tools: Support FLUTTER_HOST_ARCH in update_dart_sdk scripts (flutter/flutter#190421) 2026-08-03 chris@bracken.jp iOS: Hardcode rendering API to Metal in tests (no-op) (flutter/flutter#190422) 2026-08-03 chris@bracken.jp a11y: Map disabled/read-only semantics to AX node restriction (flutter/flutter#190353) 2026-08-03 kevmoo@users.noreply.github.com [Infra] Replace defunct umbrella template with Wasm issue form (flutter/flutter#190471) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from abecb0dc02c1 to 958c1c1921a1 (4 revisions) (flutter/flutter#190459) 2026-08-03 engine-flutter-autoroll@skia.org Roll Dart SDK from 65b163be2485 to 2a799a2404e9 (3 revisions) (flutter/flutter#190454) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from 68efb3f2ad16 to abecb0dc02c1 (1 revision) (flutter/flutter#190443) 2026-08-03 engine-flutter-autoroll@skia.org Roll Packages from 5351d8c to ac87e65 (4 revisions) (flutter/flutter#190441) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from 5a761eb826c1 to 68efb3f2ad16 (1 revision) (flutter/flutter#190440) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from 4c9f8b4805e2 to 5a761eb826c1 (1 revision) (flutter/flutter#190437) 2026-08-03 ellie@edencrew.com [macOS] Resume app lifecycle on becomeActive to avoid frozen UI after occlusion (flutter/flutter#188772) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from 39cda9d6d7d2 to 4c9f8b4805e2 (6 revisions) (flutter/flutter#190426) 2026-08-03 engine-flutter-autoroll@skia.org Roll Skia from df13bfb5a54e to 39cda9d6d7d2 (2 revisions) (flutter/flutter#190425) 2026-08-02 chris@bracken.jp iOS: Serialise CADisplayLink access in VSyncClient tests (flutter/flutter#190335) 2026-08-02 engine-flutter-autoroll@skia.org Roll Skia from 32329e5643b5 to df13bfb5a54e (1 revision) (flutter/flutter#190394) 2026-08-02 bdero@google.com [Impeller] Skip binding dead-code-eliminated resources on Metal (flutter/flutter#190040) 2026-08-01 bdero@google.com [Flutter GPU] Raise Dart errors for invalid render pipelines and memoize per-draw pipeline state (flutter/flutter#189899) 2026-08-01 41930132+hellohuanlin@users.noreply.github.com Revert "Improve non rect platform view rendering (#182662)" (flutter/flutter#190003) 2026-08-01 engine-flutter-autoroll@skia.org Roll Skia from ebf50520d720 to 32329e5643b5 (1 revision) (flutter/flutter#190389) 2026-08-01 engine-flutter-autoroll@skia.org Roll Skia from f73c4510d12d to ebf50520d720 (6 revisions) (flutter/flutter#190376) 2026-07-31 97480502+b-luk@users.noreply.github.com Primitive shape integration test (flutter/flutter#190368) 2026-07-31 97480502+b-luk@users.noreply.github.com Eliminate some early returns in uber_sdf.frag to fix broken UberSDF AA on Windows (flutter/flutter#190260) 2026-07-31 codefu@google.com chore: swiftshader mirrored + llvm16 (flutter/flutter#181225) 2026-07-31 1961493+harryterkelsen@users.noreply.github.com [web] Remove in-repo agent documentation (flutter/flutter#190326) 2026-07-31 30870216+gaaclarke@users.noreply.github.com [windows]: Uses offscreen MSAA when implicit msaa isn't available. (flutter/flutter#190256) 2026-07-31 srawlins@google.com flutter_tools: Use new FileSystemExtension from devtools (flutter/flutter#190360) 2026-07-31 engine-flutter-autoroll@skia.org Roll Dart SDK from c3acfc2479f6 to 65b163be2485 (1 revision) (flutter/flutter#190358) 2026-07-31 magder@google.com Use devicectl for screenshots on Xcode 27, remove idevicescreenshot artifact (flutter/flutter#189091) 2026-07-31 engine-flutter-autoroll@skia.org Roll Skia from 7ef86a5b0eb9 to f73c4510d12d (1 revision) (flutter/flutter#190352) If this roll has caused a breakage, revert this CL and stop the roller ...
On Xcode 27 use
devicectl device capture screenshotinstead of idevicescreenshot, which stopped working a few years ago in iOS 17 / Xcode 15.This will reach stable after Xcode 27 releases.
devicectl device capturecode for Xcode 27.toolExitwith: "flutter screenshotrequires Xcode 27 or higher." Since Xcode 15 is our minimum now as of Bump minimum required Xcode version to 15 and recommended to 16 #180531,idevicescreenshotdoesn't work with any configuration with latest Flutter so there's no reason to keep around the fallbacks if < Xcode 27._iMobileDevice.takeScreenshotandidevicescreenshotartifact.Note I left in the
run_verify_binaries_codesigned_testscheck because the binary will still be shipping in the libimobiledevice tar ball until we remove it from the recipe.flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart
Line 154 in cf9e8af
Related to #6118
Fixes #128598
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.