View files in app's filesystem for iOS for testing? - ios

I am working on an app right now that is supposed to generate a text document from an NSString , save it to the app's documents foldr, and then upload it to the iCloud.
I want to check and see if the file is actually being created and saved in the Documents folder in my app's Sandbox.
How do you look at the files saved on an iPhone? (Either on the phone
or when it is connected via USB to my Mac.)
This is just for testing purposes and all I want to do is view the file name and contents, not edit them in any way.

In addition to pdesantis's answer, you can achieve what you want through Xcode rather than relying on third-party tools. Open the Organiser, select the Devices tab, select Applications under the relevant device in the column on the left, then select the app you're interested in in the large area on the right and click Download at the bottom of the screen to grab its current local storage.

Try this
http://www.macroplant.com/iexplorer/

Related

How do I obtain a .plist saved in Documents, programmatically with Swift or manually from Finder/Xcode?

Background
I have a dictionary with more than 100 keys that I've stored in a property list that I can transfer/load/save to from one Xcode project to another.
Research
I've looked at several posts on StackOverflow but most of them seem to deal with loading a plist from the main bundle, copying it to the Documents directory and loading/saving it from there with no way of retrieving it to use in other projects.
TLDR
I want to be able to 'export' a plist created programmatically as a separate file I can use in other projects unrelated to the current one.
Update
Thanks to #NSNoob I've figured out that I can manually access the new plist from the Documents directory. Now the question is, how? Isn't iOS sandboxed without access to the filesystem unless it's jailbroken?
You can get Documents directory contents of your app like following:
Connect your device to your mac
Open your Xcode
Click on Window and select Devices
Click on your device
Search for your app in installed apps list
Click on your app
Click on gear icon
Click on Download Container.
Right Click on Saved xcappdata file.
Click on Show package contents.
That will open your documents directory and you will be able to find your modified plist there.

how to upload data to apple developer device

If I am using xcode's simulator I can upload data to the app folder (/APPID/Documents) easily.
Can push data directly to an developer device too?
The data itself is mainly xml files for the app to interact with.
The reason to do this is to make a mock-up for a presentation.
You can do that via the Organizer.
in Organizer->Devices
select the device on the left side
select the Application you are working on
on the bottom select "Download". This downloads a .xcappdata
Right click and "Show Package Contents" on the .xcappdata and there you'll see the Documents folder
Add what ever you want to the Documents folder
Go back to Organizer and click this time Upload, select the modified .xcappdata.
That should make the data available in the Documents file. Keep in mind that the app had to be installed on the device once, before you can access it on the Organizer.
Also, it could take quite some time if the data are heavy files. But as you just want the xmls it shouldn't be a problem.
[EDIT]

Accessing Files from iOS

I know it is possible to access the gallery photos and pick them as UIImage using UIImagePickerController, but I want to know whether all other files like doc, txt, pdf etc can be accessed from device please help.
thanks
You can, but there's no built-in picker like there is for images. Take a look at the NSFileManager class for enumerating directories and working with files.
There is no GUI API to access the file system, you can create your own UI and read and write from your app's documents folder though.
There is no universal space to store that document in iphone like photos and videos. but you can store in your app and and using itunes file sharing you can access it.
here is the way to enable itunes file sharing.
you can store in icloud and access it from app.
Select your project in top left
Select target in next column
Click on Info tab
In Custom iOS Target Properties, hover mouse over any row and click +
In popup, select "Application supports iTunes file sharing", then set Value to YES on right
Click Validate Settings at bottom to make sure all is good

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.

Get data from user test on device to mac

I'm doing some user tests of my new iOS app and store some test data in a plist. When I do that in the simulator it is easy to get that file for further analysis on my mac, but how can I easily get it from a real device? This will only be used during testing and will not be part of the final version.
Possible ways I have read about but not tried (in hope to get some directions here first):
E-mail attachment
Enable file transfer to iTunes
Jailbreak (but don't want to)
Currently what I am doing is to NSLog it and copy and paste from Xcode into Excel, but this requires that the device is tethered to my mac.
Any experience or advice on easiest way to get this done?
I sometimes use iPhone Explorer to do this, because the plist file I want is not in my Documents folder. I use it to navigate to the files associated with my app on the device. Just connect your device to your laptop, run iPhone Explorer and then use it to locate the plist file you want and drag and drop it wherever you want.
You can save data from Organizer. Just click on your device and it'll show in right pane. Files from documents folder and possibly other folders can be saved.

Resources