App Files Not Visible on Device

I am writing an iPhone app using Swift under Xcode 9 which stores text data in a file in the device sandbox. When I run it on a simulator (iPhone 6), it works fine, and the file I wrote is visible in the Library folder (after drilling down through a bunch of levels 🙂).


But when I run the app on my iactual Phone 6, while it runs fine, the files are not visible (i.e., no errors are thrown, but I can't see the files in Xcode's Devices and Simulators window).


I've submitted a question on stackoverflow, with the relevant code, which you can read at https://stackoverflow.com/questions/51461220/file-not-created-in-iphone-documentsfor more information.


I've tried unpairing and re-pairing the iPhone; no joy.


I'm new to Swift and iOS (most of my experience is in Windows, with C# and javascript), so I wouldn't be surprised if I'm missing something basic.


Suggestions?