Skip to main content
Pushes a file from the host onto the device at a target location. There is no simplified form. path and location are required.

Parameters

Location

Android

location is an absolute file path on the device. Put media under a media-scanned directory (e.g. /sdcard/Pictures, /sdcard/Download) so it shows up in the gallery.

iOS

location is either a bare filename or an app-container path:
  • A plain filename with no parent directories imports the file into the iOS Photos library (the camera roll the system photo picker reads from). Keep the real image or video extension. Only images and videos are supported here.
  • The @<bundle-id>:data/<path-inside-container> form writes the file into the app’s private data container. Use this for non-media files (e.g. PDFs) and anything the app reads from its own storage. <bundle-id> must be an app installed on the device (the one you openApp). iOS files belong under Documents/ (e.g. @<bundle-id>:data/Documents/file.pdf): iOS exposes only the app’s Documents/ directory to the Files app, and most apps read user files from there, so a file written to the container root (e.g. @<bundle-id>:data/file.pdf) does not show up in the app. Use another subdirectory only if the app you’re testing reads from a different location.