Skip to content

mobile: pushFile doesn't escape paths of parent directories. #1004

Open
@jesse-r-s-hines

Description

@jesse-r-s-hines

The mobile: pushFile command automatically creates parent directories if they don't exist, which normally works fine. However if the parent directory contains a space, it isn't escaped causing errors like

[0-0] 2025-07-05T19:39:54.050Z ERROR webdriver: WebDriverError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/home/jesse/Android/Sdk/platform-tools/adb -P 5037 -s emulator-5554 shell mkdir -p '/storage/emulated/0/Documents/my folder'' exited with code 1'; Command output: mkdir: 'folder': Read-only file system

If the file basename contains a space it works fine, it only if the parent directory contains a space.

Example to reproduce:

browser.execute("mobile: pushFile", {
    remotePath: "/storage/emulated/0/Documents/my folder/foo.txt",
    payload: "SEVMTE8=",
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions