Great Java - Caffeinated Babblings!

  • Home
  • Coffee Brewing HOW-TO
  • General
  • Web
  • Coffee
  • Java
  • Social Media
  • Coding
Caffeinated Babblings!

apple

Copying Files into Xcode 27 Device Hub Simulator

October 2, 2026 by Mark Leave a Comment

I’ve been doing some iOS development with new Device Hub simulator in Xcode 27 and ran into what seems like it should be a really simple problem – copying the file from my Mac to the simulator.

With the older Simulator app I could just drag something like a JSON or CSV file from Finder onto simulator. It would show up in the Files app and I could select it using my app’s file picker.

That doesn’t seem to work with the simulator running inside the new Device Hub. Found a few hints on Google search, and eventually got a working combination to do it with simctl and rsync.

Copying It Somewhere Doesn’t Seem to Be Enough

Since the simulator’s filesystem is sitting right there on the Mac under:

~/Library/Developer/CoreSimulator/Devices/

My first thought was basically well I’ll find the right simulated Downloads directory and copy the file there. I think maybe did that long ago before figured out the drag and drop option.

I could copy my JSON file there, run ls, and see the file was there. Unfortunately the Files app couldn’t see it and neither did file picker in my application. No, restarting the simulated phone didn’t seem to make help.

Finding the Storage Used by Files

What finally worked for me was using the shared container associated with the Files app. This was a detail I found in a forum post.

First find the simulator you’re currently running:

xcrun simctl list | grep Booted

That gives you something similar to:

iPhone 17 Pro (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) (Booted)

Take that device ID and ask simctl for the Files application’s group containers:

xcrun simctl get_app_container <DEVICE-ID> com.apple.DocumentsApp groups

You’ll get several entries back. The interesting one for this purpose is:

group.com.apple.FileProvider.LocalStorage

The path next to that appears to be the local storage used for files app “on my iPhone”.

Inside that directory is another directory named:

File Provider Storage

Copying my file there (with rsync) finally made it show up in the Files app.

The Slightly Weird Part

I originally tried copying the file using cp. That didn’t work correctly for me. In some of my testing I ended up with a zero-byte or unusable file. Maybe user error, I’m not sure.

Using rsync instead worked:

rsync -av my-file.json "<LocalStorage path>/File Provider Storage/my-file.json"

After doing that I could open Files on the simulator, select “on my iPhone”, and there was my file. No idea why and didn’t even Google it to see.

Making It Less Annoying

Great quick and easy use of Claude Code agent, create a script! Here’s a small script that finds the Files app’s LocalStorage container on the currently booted simulator and copies whatever file you give it. I didn’t test it with multiple simulators running.

#!/bin/bash

if [ "$#" -eq 0 ]; then
    echo "Usage: simfile <file> [file...]"
    exit 1
fi

LOCAL_STORAGE=$(
    xcrun simctl get_app_container booted com.apple.DocumentsApp groups |
    sed -n 's/^group\.com\.apple\.FileProvider\.LocalStorage[[:space:]]*//p' |
    head -1
)

if [ -z "$LOCAL_STORAGE" ]; then
    echo "Could not find the simulator LocalStorage container."
    echo "Make sure a simulator is booted."
    exit 1
fi

DEST="$LOCAL_STORAGE/File Provider Storage"

echo "Copying to:"
echo "$DEST"
echo

rsync -av -- "$@" "$DEST/"

Save it as simfile, make it executable:

chmod +x simfile

and then:

./simfile ~/Downloads/test-data.json

After executing it file should then be sitting under “On my iPhone” in the simulator’s Files app. Restart the simulator if you don’t see the update.

Good Enough for Now

There may be a cleaner (or official and proper way) to do arbitrary file transfers with Device Hub that I’ve missed!

Posted in: General Tagged: apple, code

Why Google is Winning

January 28, 2009 by The Great Java

Google is winning because it works.  People like things that “just work”. 

Let’s look at home computers.  They have become more complicated and error prone.  This has to do with Viruses, half-baked software, Microsoft engineering, and too many options on hardware.  Users get frustrated when their IT friend says, “Just buy a new PC from Best Buy”.  The answer is usually upgrade the hardware, wipe the drive, put better virus software on…. But the answer to “just make it work” is get a new PC.  Wonder why a lot of people are trying the Mac?

How about Google?  What “just works”? For an experiment I tried the Yahoo search bar in my browser first for two weeks. After a few searches I usually reverted to Google, and got what I wanted on the first page of results.  Today I’m switching my default search bar back to Google.  Remember “just works”?  Try putting “buy Mark lunch next Friday” in your Google calendar.  Yes, it will figure it out.  Google Calendar “Just works”. 

Rather than wrangling over features and functionality I’ve started just asking the question “Does it just work”?

Posted in: General Tagged: apple, google, mac, pc, works

What’s Wrong with the iPhone?

October 7, 2008 by The Great Java

Apple is what is wrong with the iPhone. Apple tightly controls several aspects of the phone. The software development interfaces don’t allow you to access some of the core data on the phone. This means you won’t find a great replacement calendar in the App Store. In addition, Apple also does not allow programs to run in the background while the phone is off. This means that 3rd party programs can’t trigger your phone to awake if a new IM message appears or you reach a specific GPS coordinate. Forget about taking “Remember the Milk” to a whole new level by alerting the user when they drive by that convenience store on the way home!

If Apple had done a better job at some of the core programs this might not have been as big of an issue. The calendar program is attractive but is very lacking. I’ve listed a few items below:

  • Calendar Entries cannot be emailed. This was a real let down for me.
  • Calendar has almost no settings that can be changed. I’d love a default 15 minute alarm. Wouldn’t you?
  • No task list integration
  • No iCal support for external calendars, this should be simple
  • No OTA calendar synchronization

If there was an open API in this area, and you could convince Apple to put the program on it’s “App Store” there would be an answer overnight.

The second big issue is programs running in the background. Apple might have some good reasons for this but certainly there is a way to provide a hook or some rules to “protect” the platform. Even Windoze Mobile programs could do this (ouch). Let’s say I download a great streaming music program and want to browse the web or read an ebook. Not on the iPhone. Only the Apple iPod program can play music in the background and they don’t support streaming audio!

Apple please don’t forget that the “open market” principles work best on your platform and App Store too!

Posted in: General Tagged: apple, iphone, mobile, send help

Great Commericals.

April 3, 2008 by The Great Java

Apple has great commercials. The PC/Mac guy ads are always good for a laugh. Here’s one if case you haven’t seen them.

I recently got an iMac, 20″ LCD screen. I’ve mostly liked it. I’ve had problems with some of the graphics I created for my friend Steve’s website. The top graphic has a background with a slight gradient that looks great, except on my Mac. On the Mac it’s invisible. I assume it’s something about the Safari browser at first, but then FireFox on the Mac has the same display problem. I’m baffled. Maybe my windows graphics program creating some magic windows-only jpeg image!

Then coincidentally my friend Brian tells me about the new class action lawsuit on the iMac I bought. Now all of a sudden it makes sense. It’s the monitor! So I send the URL to a friend with a new macbook – he can see the image fine. It’s time to visit the mac store and make sure it’s not just my monitor. This would be a huge disappointment. I mean I’m used to computer companies advertising false things, using cheap stuff, and of course Windows.

Maybe I believed the commercials…

Posted in: General Tagged: apple, commerical, mac, osx

Copyright © 2026 Great Java - Caffeinated Babblings!.

Taste WordPress Theme by ThemeTaste

imunify-bot-check