Is there a simple way to adding files to iPhone simulator, for use with Xcode?

Correct me if I'm wrong, but with the latest version of Xcode (15.x) you can no longer add files to the iPhone simulator by dragging them into the the Files app.

I also tried to share the files from my Mac desktop to the simulator. But after selecting the simulator, absolutely nothing happened.

So I had to do it the long way:

  1. Add a folder to the simulator with a unique name, in the Files app
  2. Get the document path, print(URL.documentsDirectory.path())
  3. Back track into the folder structure till I find that folder
  4. cp the files to that folder

Please tell me that there is a way that I haven't found on Google, or that I somehow was doing what the Apple dox suggested, but missed a step.

Answered by Claude31 in 789658022

I just tested on iPhone 15 Plus simulator with iOS 17.4 and Xcode 15.3.

  • show Files folder in simulator

  • drag a file from Finder:

  • Save with the button on top right

That's it.

I just tested on iPhone 15 Plus simulator with iOS 17.4 and Xcode 15.3.

  • show Files folder in simulator

  • drag a file from Finder:

  • Save with the button on top right

That's it.

From Add files to Simulator:

To add files to Simulator, select one or more files in Finder on your Mac, then click the Share button. Select Simulator from the share destination list. Choose the simulated device from the drop-down list. Simulator opens the Files app, and lets you select where to save the files.

As I stated in the OP , this doesn’t work.

Is there a simple way to adding files to iPhone simulator, for use with Xcode?
 
 
Q