Skip to content

OMG! My ~/Desktop was nuked! #186412

Closed

Description

@hellohuanlin

Steps to reproduce

I am following this instruction to run UIScene integration test:

https://github.com/flutter/flutter/blob/23f6f5853f50c4ee200d9f6aa0f1015b36e70e3c/dev/integration_tests/ios_add2app_uiscene/README.md

Specifically:

The test create the Flutter module, Flutter plugin, and native iOS app and deletes them at the end of the test. You can also create these files in a specific directory that will not be deleted:
../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t module_uiscene_test_ios --task-args destination=[/path/to/copy/destination]

So I ran

dart bin/test_runner.dart test -t module_uiscene_test_ios --task-args destination=~/Desktop

Expected results

I was expecting the project to appear in ~/Desktop.

Actual results

It nuked my desktop. This is due to:

destinationDir.deleteSync(recursive: true);

Code sample

NA

Screenshots or Video

NA

Logs

NA

Flutter Doctor output

NA

Activity

  1. vashworth commented on May 12, 2026

    @vashworth
    Contributor

    Lol I think I intended for it to be more like

    dart bin/test_runner.dart test -t module_uiscene_test_ios --task-args destination=~/Desktop/directory_for_test

  2. hellohuanlin commented on May 12, 2026

    @hellohuanlin
    ContributorAuthor

    Lucky someone didn't accidentally run destination=~ or destination=/. It's wild that a random script can cause so much damage. A warning before deleting would be nice.

  3. hellohuanlin commented on May 12, 2026

    @hellohuanlin
    ContributorAuthor

    Lol I think I intended for it to be more like

    dart bin/test_runner.dart test -t module_uiscene_test_ios --task-args destination=~/Desktop/directory_for_test

    It's safer to only delete the folders/files that flutter itself controls. The script can create the project folder under the path (e.g. generated_project). Then when deleting, we only delete generated_project folder (the "Expected" behavior in the description)

  4. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on May 14, 2026
  5. github-actions commented on Aug 10, 2026

    @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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions