Yosemite, iOS 8 and iCloud drive: syncing mobile to desktop? - ios

I have a couple of iOS 8 apps that make use of the new iCloud Drive service and the native API for copying files to the app's personal iCloud file directory. Using two separate devices, I can upload files on one device, and download it on the other: so far so good. Now, having upgraded my macs to OS X.10 Yosemite, I have the iCloud Drive folder, but it only shows the files from the one applicable Apple product that I ever use (Keynote):
The files that are happily syncing between mobile devices are nowhere to be seen; I'm pretty sure that the documentation implies that they're supposed to be there, and that the distinction between mobile & desktop folders has been taken away. If I hunt around in ~/Library/Mobile\ Devices, I can find them, so they are updating behind the scenes. Or perhaps that update happened when the computer was still running OS X.9 Mavericks.
Anybody know what I'm missing?

On Yosemite it seems Finder is treating iCloud as a special folder, so it doesn't show the hidden files and folders. If you use Terminal to examine ~/Library/Mobile Documents/ it all seems to be there.
Trying to put the full pathname into Finder just dumps you back at the 'official' iCloud view, so it looks like Terminal is required in order to browse these on OS X.

What fixed it for me was going to System Preferences, iCloud, unchecking iCloud Drive, restarting the computer, and then repeating but this time checking iCloud Drive.

I discovered an easy way to view the original Mobile Documents folder without the view switching to the new iCloud Drive view.
Access your hidden Library folder within your User folder. (for example, click the Go menu in Finder while holding down the Option key)
Then select the Mobile Documents folder and create an alias to it (by right clicking)
Now, double-click to open the alias. Presto. This opens the actual Mobile Documents folder.
You will notice that some of the folders names have changed. You will note the iCloud Drive folder is also present.
It may be helpful to use the terminal or another utility to unhide the hidden files in Finder.

Related

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 )

Is there any way currently to browse an App Folder / App Sandbox on an iOS device with iOS 9

As a developer doing many operations with files in my own apps' sandboxes (An app's subfolder environment such as Documents folder etc.) on the device, I found it extremely useful to be able to browse my app folder to see if my code was writing things to the correct places etc. I always used to use iExplorer for this & it was vital. To my horror, I came to do the same browsing today, only to find that you can no longer look inside the app's folders with tools like iExplorer. Some research tells me that as of iOS 8.3, Apple have placed restrictions which stop these tools from doing the great job they did.
Is there a work-around now at the iOS9 stage or even any tools that still manage to do it? This was so essential as a dev.
I'm assuming you mean a physical device, not the Simulator. In that case, you could open the Devices window (Xcode > Window > Devices) and then select the relevant device on the left.
In the Installed Apps section, select your app, and then click the gear icon which will give you a menu to Show, Download or Replace Container...
Now, it's available FileBrowser to browse the content of an app folder (in its sandbox).

Debugging & accessing NSDocumentsDirectory in real device

I have my apps using NSDocumentsDirectory for saving the downloads & offline data on device. From debugging point of view, I was debugging as usual on simulator & was trying to access the path for these downloads & I was able to do that. I have my doubts as :
I am not able to access the location /var/mobile/Applications/SOME-HEX-CODED-PATH/Documents/ via terminal that was shown in the NSDocumentsDirectory paths during debugging on device. Whereas in iOS Simulator I am able to open , read/ write at that location.
I am not able to browse through the /var/mobile directory as it is not listed in the finder, not even as hidden directory.
Is that directory is mounted on runtime ?
Please clarify.
I am not sure to fully understand your question. You want to access, from your laptop, the filesystem of your device?
You are not supposed to do that on a regular device at least. If you want to browse your documents directory do it through the organiser (Window/Organiser) and then "devices" tab and select your device and your app. You will be able to see your sandboxed filesystem in the bottom part and downloaded its content.

Check files in Documents, Library or tmp directory on iOS device

I am making on an app and want to get access to the directories that system create automatically when app installed on device. Of course when I use simulator I can find these directories without any problems, but how to open them on device. Maybe via iTunes or maybe Xcode has access to these directories.
The folders are below:
Why I need it:
Because after my app restore some products (iOS simulator does not support StoreKit) I have few records in the tmp folder in SQLite database.
#neilco , it's not necessary to use 3d party tools for this. In Xcode, go to organizer, select the connected device, "applications" tab, select desired application and hit "export" button below. This will export you app to your mac, so you can see your depicted folder structure, files' contents etc.
Take a look at using iExplorer as this allows you to views the folder structure of apps on a device.

Resources