iOS Simulator: Add Media
ios_simulator_add_mediaSeed an iOS Simulator's photo library with images or videos so app pickers can be tested without a physical camera. Files are copied in, keeping originals intact.
Instructions
Put photos or videos into the simulator's photo library. A simulator has no camera, and this is how you get around that: seed the library first, then drive the app's picker as normal. Without it, every flow that starts with an image is untestable here. Files are copied in, so the originals are untouched and the simulator keeps them until it is erased. Pair it with permission on ios_simulator_set_environment to skip the access prompt entirely.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Absolute paths to the images or videos, e.g. ["/Users/me/fixtures/monstera.jpg"]. Formats are the ones Photos itself accepts — JPEG, PNG, HEIC, MOV, MP4. | |
| device | No | Which simulator: its UDID or its name as shown by ios_simulator_list. Omit it when exactly one is booted — that is the normal case, and IOS_SIMULATOR_ID pins it when it is not. Unlike simctl's own `booted`, this never picks arbitrarily between two. |