Skip to content

Take platform screenshots on Android #152189

Closed

Description

@matanlurey

FlutterDriver already supports taking a screenshot, but this screenshot is based on the Flutter engine's view of the world, and as a result, omits platform-views (views that are drawn and managed by the platform).

An example of platform views include:

Using a new API (e.g. nativeDriver.screenshot()), it should be possible to take a "native" screenshot, using whatever the platform provides. For example, on Android, this would likely be (a variation of) adb shell screencap, on iOS idevicescreenshot, and so on.

These screenshots will not be cropped, and may include system shell UI. The former will not be addressed at the moment, but the latter can be partially addressed by using a device's appropriate "demo mode" (sometimes called "immersive mode"), or otherwise trying to create a somewhat hermetic screenshot environment (to the best of our ability).

Platform screenshots will likely be opaque objects, because they will exist as a file on disk, not bytes.

Activity

  1. converted this from a draft issue on Jul 23, 2024
  2. self-assigned this
    on Jul 23, 2024
  3. added
    c: new featureNothing broken; request for a new capability
    c: tech-debtTechnical debt, code quality, testing, etc.
    P1High-priority issues at the top of the work list
    on Jul 23, 2024
  4. ueman commented on Jul 24, 2024

    @ueman
    Contributor

    This seems related to #102866, where the functionality of taking "screenshot"s via RepaintBoundary for PlatformViews is requested. If that's done, it would also resolve this, wouldn't it?

  5. matanlurey commented on Jul 24, 2024

    @matanlurey
    ContributorAuthor

    This seems related to #102866, where the functionality of taking "screenshot"s via RepaintBoundary for PlatformViews is requested. If that's done, it would also resolve this, wouldn't it?

    I don't think so, all this is doing is adding a flutter_driver-specific API for using the platform screenshot mechanism.

  6. github-actions commented on Aug 7, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: new featureNothing broken; request for a new capabilityc: tech-debtTechnical debt, code quality, testing, etc.t: flutter driver"flutter driver", flutter_drive, or a driver test

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions