Inspect iOS user's documents folder remotely - ios

Recently a user of one of my apps reported that all her data was lost when she updated the app. I think this is a long shot, but is there anyway for me to inspect her 'documents' folder within the app on her iPad? Or a way for her to send me her document folder so I can see what's going on and hopefully salvage the data?

If she is a fairly technically capable user, you could have her use PhoneDisk http://www.macroplant.com/phonedisk/ to mount your app's sandbox and inspect the Documents folder.

If it is a jailbroken device you could ask her to download teamviewer, then ssh into the iPad.
Never tried it though! But that was an idea I got when I saw your question.
http://www.idownloadblog.com/2011/03/14/how-to-ssh-into-your-iphone/

Related

Any ideas on how to batch delete iPhone albums from photo library?

Problem: I have a friend's iPhone that I am working with who had some 3rd party Canon app that created an overwhelming amount of "Albums" (5848499495 of them to be exact!!).
Refer to this video
Obviously, this definitely shouldn't happen and we're trying to see what's the best way to delete all of them.
I was thinking of accessing the files via SSH on the iPhone to see if these "Albums" are represented as directories somewhere in the iPhone's file structure and run some type of shell script to batch remove files as we would on our Macs but I realize that this will require some jailbreaking which we're trying to avoid doing if possible. But will consider it if it's easier to do it that way.
I also tried to see if there were Command Line tools for the iPhone to directly access the root folder to see if we could find the directory but I realize that there are permission issues associated with accessing the iPhone's files without jailbreaking.
These albums are stored locally on the phone, and it's not in iCloud. We tried to see if these folders show up on Mac's photo app after syncing but because they are empty folders, it doesn't show on the app.
Note: we're on a Mac, and the model is an iPhone X running the latest iOS 14.
I'm all out of ideas and any help would be wonderful.
Thanks!

Create a file through a Cordova/Phonegap app that can be opened by another app (ios)?

I'm able to create and save files using cordova-plugin-file, and have been saving and accessing them from within the app to cordova.file.documentsDirectory.
The problem it seems is that all the directories that one can save to are private, Cordova-plugin-file documentation
I would like to be able to have these files saved in (or moved to) the ios blue "files" folder, so that they can be opened by other apps such as Numbers, Pages, etc. It seems so simple there has to be a way to do this, but I can't find it after more than a few evenings of searching and trying different ways.
I'd be grateful if someone could point me in the right direction.
From what I can tell you can save to the documents directory "cordova.file.documentsDirectory". By default this directory is shared with iCloud, so a file saved here could be opened through the ios File folder and a user could then select the files and hit the share icon to open with the appropriate app, such as Numbers etc.
In order to turn on iCloud you have to pay the developer fee to Apple and select the options to do so. I found the article "Working with the Files App in iOS 11" to be helpful in starting this process.
I don't have the paid developer account yet, but from what I'm reading it should work once I activate one. I'm open to a better solution or critique.

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 )

Having a bit of trouble with copying a local file on iOS

Having only worked with Android/web dev before I am having a hard time figuring out where in the world my file should be getting copied to in iOS. After reading the file browser documentation on the iOS developer resource page it says that each app is an "island" which contains its own folder system. If I want to have my user be able to copy a file from my app's sdk to their iOS device, where should I put it?
I downloaded a file browser app from the app store on my iOS testing device but am I right in thinking that there is no global file browsing system?
I am using a Cordova plugin called Asset2sd which works perfectly for me in Android, getting the root storage folder and downloading the file to there. It has no iOS alternative so I'm going to have to figure something else out, I just need to know where to start. Do I have to have the user access my app's internal files somehow? Can I create a folder for them to look in when they download my app? Some documentation or something would be wonderful. I am totally lost.
Thanks!
You're right. Apps don't have access to the global file system. Each app only has access to their own app directory. Here's in-depth information on Sandboxing: https://developer.apple.com/app-sandboxing/
In your app's sandbox, you basically can manage files as you want, i.e. download, copy, move, delete, etc. So you can create a folder Downloads in your apps documents directory and then display the contents of this folder for instance in a table view.
Related documentation/links:
https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/index.html
https://stackoverflow.com/a/6907432/967327
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iPhoneAppProgrammingGuide.pdf

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