-1

I am writing an iOS app, and I wish to be able to copy data directly from the iOS device using a laptop.

A good example I found is Wikipedia's official iOS app (https://apps.apple.com/app/wikipedia/id324715238?mt=8). After I downloaded this app and used it for a while, I see a directory structure built in afc://.../org.wikimedia.wikipedia if I connect my device to a laptop running Linux. The structure is like below:

├── assets
│   ├── about.html
│   ├── abusefilter.css
│   ├── abusefilter.html
│   ├── bundle.js
│   ├── footer.css
│   ├── index.html
│   ├── index.js
│   ├── ios.json
│   ├── languages.json
│   ├── mainpages.json
│   ├── preview.css
│   ├── preview.html
│   ├── preview.js
│   ├── styleoverrides.css
│   ├── styles.css
│   └── Wikimedia-logo.png
├── piwiktracker
├── piwiktracker-shm
├── piwiktracker-wal
├── WikipediaYap.sqlite
├── WikipediaYap.sqlite-shm
├── WikipediaYap.sqlite-wal
└── WMFHomeSections.plist

However, I am not able to find some official documents or tutorials, that teach me how to write a Swift program that accesses or modifies this directory. What I want to do is basically opening a text file and write some lines into it. Any help will be appreciated.

Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32
  • You aren't even supposed to access anything outside the sandbox folder assigned to your app with a proper channel. – El Tomato Aug 04 '19 at 09:38
  • Maybe I am not clear enough. I want to access this folder (maybe it is called "sandbox folder" or "Documents"?) of my own app from Swift, instead of Wikipedia's folder. But I cannot find APIs that allow me to access that. – Eric Stdlib Aug 04 '19 at 11:25

1 Answers1

0

It seems that what I am trying to find is the Documents directory in my iOS app's sandbox directory (from documentation). The directory can be made visible in afc protocol by following this answer, and this answer gives a good example of writing to a file in that directory.

Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32