Skip to main content

upload · push_path

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Put a file from this machine where the device keeps downloads, so an app's file picker finds it: Android's shared Download folder, or on iOS an app's own Documents folder, which the Files app shows under On My iPhone. These call app_upload.

upload​

def upload(path: str, name: str | None=None, app: str | None=None) -> dict

Put a local file where the device keeps downloads, so an app's file picker finds it.

On Android that is the shared Download folder, one for every app, and the file is indexed in MediaStore and read back there, because the picker reads MediaStore rather than the folder. On an iOS simulator it is an app's own Documents, which the Files app shows under On My iPhone: the app named, or the one in front. On a real iPhone it is the same folder, and the upload is confirmed by reading its bytes back.

name is what to call it on the device — a name, not a path — and defaults to the file's own. Returns the transfer: name, where, bytes and checked, which says how it was confirmed.

push_path​

def push_path(local: str, device_path: str, app: str | None=None) -> dict

Send a local file or folder to a path on the device, and read every file's size back there.

On Android device_path is absolute (/sdcard/..., /data/local/tmp/...), or with app a path in that app's private data, which needs a debuggable build. On iOS it is a path in an app's data container — app, or the one in front.

Examples​

Send a file where the device keeps downloads​

sent = device.upload("invoice-42.txt")
print(sent["where"], sent["bytes"], sent["checked"])

The same call from the command line, mobium upload invoice-42.txt, printed on an Android 15 emulator:

uploaded …/invoice-42.txt to Download/invoice-42.txt (24 bytes) — confirmed by its size read back on the device, and MediaStore listing it

After mobium upload invoice-42.txt, the Files Demo's Upload a file opened the system picker, the file was in it, and the line under the button says the name, size and first line of what arrived — on an Android 15 emulator

After mobium upload invoice-42.txt, the Files Demo's Upload a file opened the system picker, the file was in it, and the line under the button says the name, size and first line of what arrived — on an Android 15 emulator

Send a folder to a path on the device​

sent = device.push_path("seed", "/sdcard/seed")
print(sent["files"], sent["checked"])

The same call from the command line, mobium upload ./seed --device-path /sdcard/seed, printed on an Android 15 emulator:

uploaded …/seed to /sdcard/seed (a folder of 2 files, 8 bytes) — confirmed by each of its 2 files' sizes read back on the device