accessing iphone file system and copy file - ios

I'd like to know way to access iphones file system and copy files to app's documents programmatically on windows platform. I know there are several programs accoplish this goal here . Also it shouldn't be against the apple licence.
thanks.

As the very article you link to states:
First of all you need have a jailbroken device.
With a device that is not jailbroken, you can not access the filesystem directly.
Any form of jailbreaking breaks Apple's EULA. Thus what you request can't be done.

Related

How safe is to store files into the document directory?

I am writing an iOS app in Swift and Xcode where I allow users to download some files from a server and to store them into the iPhone's document directory.
How safe is it to do so?
Is it possible for a user to access one of these files from outside the app, for example by connecting their phone to a computer, and move them around or share them? If a user has a jailbroken iPhone, could he get a way to access the downloaded files in other ways other than the one I allow within my app?
And if so, should I encrypt my files when I download them?
For jailbroken iPhone i think yes it's possible to access apps directories.
For normal iPhone I'm pretty sure other apps can't access it as all third-party apps are “sandboxed"
https://support.apple.com/en-gb/guide/security/sec15bfe098e/web#:~:text=Sandboxing,information%20stored%20by%20other%20apps.
And no idea about connecting their phone to a computer.

iOS, config files and sandboxing

My understanding is that because of sandboxing, it isn't possible to view any text file (ie config file) associated with an iOS app using another app. Something quite simple with Android. Am I mistaken?
I am trying to implement a text config file with a Unity iOS app that gets loaded and parsed once when the application boots.
This config file would also be able to be edited and saved manually on that actual iOS device.
(addendum)
In Unity there is PersistentDataPath which resolves to /var/mobile/Container/Data/Application/foo/Documents
Is there an iOS supported file explorer app that will allow me view and edit files in this location (without jailbreaking)?
Use can check iOS App Groups. It allows multiple apps access to shared containers and allow interprocess communication. There is no so much documentation about this, but maybe that's what you're looking for. At least you can share NSUserDefaults between the apps.
NSUserDefaults it's a most simple way to save any (not big) configurations for your app. For manual editing: if your app on the device signed with developer certificate, you can connect through any iOS supported file explorer app and edit it. But after release, from App Store, your app installed in restricted/private path, so it's not possible, if only you don't have a jailbreak.
Initial configuration you can put into your app bundle, and at the first run just copy them to NSUserDefaults.
Short answer: There are utilities such as iExplorer - https://macroplant.com - that allow "file manager" type access. However...
Long answer: If your app requires users to buy (or get) other software to modify configuration files, the chances of Apple approving it are slim to none.
The appropriate thing to do is to provide a User Interface in your own app which allows the user to modify / update the settings.

iOS File Retrieval - NSDocumentDirectory

I am working on a library with a very verbose logger module that, on iOS, writes xml logs to NSDocumentDirectory in a consistent file tree. I want to come up with a way for the user of this library to easily access these logs.
I know it is simple to programatically retrieve files from this directory, but is it possible to access this directory on an iOS physical device in any way from outside Xcode to retrieve these logs? I feel like I have seen it somewhere before, something in the manner of extracting the .ipa file and going into the package contents, but I could be wrong.
---------------------------------------------------------EDIT------------------------------------------------------------------
This (Browse the files created on a device by the IOS application I'm developing, on workstation?) is how to do it with Xcode on a device, but I have to assume that there is some way we can create that gets the logs off of a device for a user.
is it possible to access this directory on an iOS physical device in any way from outside Xcode to retrieve these logs?
It is possible to expose the Documents directory by enabling iTunes file sharing. When file sharing is enabled through this method, the contents of Documents directory would be visible to the user in iTunes, which can also be exported. The documents would also be visible for export through some third party desktop apps like iExplorer.
Here is the link to Apple documentation. You may also refer this thread to understand how this is done.
If you're using a simulator (apparently your task doesn't seem to need te real device) you are in luck.
You should go to a folder similar to this one:
/Users/[YOUR_USER_NAME]/Library/Developer/CoreSimulator/Devices/[RANDOM_HASH_YOU_SHOULD_DISCOVER]/data/Containers/Data/Application/[RANDOM_HASH_2_YOU_SHOULD_ALSO_DISCOVER]
Once there, with finder, you'll get the "documents" folder of the simulator and the app you're trying to retrieve your logs from.
You might say: I don't know which 2 RANDOM_HASHES should I go to.
Yes, you're right. If you have MANY simulators installed and or being used, it might be tricky to discover which one is the one you're trying to debug.
The same thing with your APP, your app will live in another RANDOM_HASH folder, and you should browse them, one by one, and then discover your documents folder.
Someone needed to solve this "mess" and created a Xcode Alcatraz Extension that leads you to the exact live simulator and APP you're debugging in any given moment, and then you don't need to guess which 2 random_hash paths you need to navigate to.
If Xcode + Alcartaz plugin extension manager is somewhat out of your reach, you might need to google it. It's not a difficult process.
PS: That magical Alcatraz Extension is named "XCodeWay" (in case you are brave enough to install Alcatraz onto your copy of XCode).
EDIT: Useful link to get Alcatraz: http://alcatraz.io/ Follow its easy instructions and you're done.
EDIT2: If Xcode cannot be used, then the last question in this other thread might come in handy: Browse the files created on a device by the IOS application I'm developing, on workstation?
(Still, an external application in your users machine will be needed )

ios copy file to another apps file directory

Is there anyone that got an idea of how to copy files to another apps file directory in ios? I need a service for this so I can from my app simply hit a button and what my app does is copy a file to another apps directory? will that be possible? I am ready to pay for a person that can help me with this?
iOS apps are sandboxed and are not able to directly access the contents of another app's data. There are ways for apps to interact with each other, but these require user interaction and are limited to specific use cases. For more info, here are some docs from Apple on inter-app communication:
Document Interaction Programming Topics for iOS
Inter-App Communication

View the file system of iPad/iPhone to verify saved files

I would like to be able to view the file system of my actual iPad/iPhone to verify that files are being written correctly. I can do this using the simulator by navigating to Users/me/Library/Application Support/iPhone Simulator/6.0/Applications/specific app/Documents. Here I can see all of the files and data I have written from within my app.
I would be really helpful if anyone knows of an app or some way of viewing the file system of my apps WITHOUT JAIL BREAKING
Thanks in advance
Take a look at iExplorer:
http://www.macroplant.com/iexplorer/
Also, look at this question:
https://apple.stackexchange.com/questions/54682/easiest-way-to-browse-iphone-filesystem
Strongly recommend iFunbox, take a look at LifeHacker review here. Easy to use and you can even access your iPhone over WiFi. No jailbroken required too.
You should try DiskAid: http://www.digidna.net/diskaid which is way better than iExplorer. You can connect to your iPhone or iPad via Wi-Fi and USB and browse your iOS file system, app sandboxes and it supports multiple device and simultaneous file transfers.
I am almost 100% sure this is not possible without a jailbreak (at least not on the device itself). If it works on the simulator, then it should be saving correctly on the actual device. If you need to verify it, just read the file from your app, and turn it into an NString, and NSLog it.
Then you will know if it is working.
Cheers.
EDIT
Of course, as others have mentioned, there is iExplorer, but you have to view the files on a Mac. And it won't show system files.

Resources