What is the simplest way to get log files off of an iPhone? - iphone

I have logged my NSLog statements to a file in my iPhone app.
What is the simplest way to grab this data off the phone?
Is there a way to copy the file from Xcode's organizer or some other GUI interface/CLI utility like that or do I need to grab the contents of the file programmatically?

Using the Xcode Organizer, you can "Download" all of your app's files.
1) Open the Organizer.
2) Connect your device.
3) Select "Applications" under that device.
4) Click the Download button for the application.
5) Save the folder to your Desktop.
Your app's Documents folder will be in the folder that you save, along with the Library and tmp folders for that app.

inside of Xcode (in the organizer) you can click your application, expand it and copy the logs to your local machine

As the file is in your apps docs folder you can switch on iTunes filesharing in your plist
UIFileSharingEnabled
and copy it off the device via the iTunes interface.

Related

How to see the result of sqlite database file in firefox plugin when the app is run on iPhone device

I am using sqlite database in my app. When I run the application from simulator then I am able to see the result in firefox sqlite plugin in my .sqlite file. But when I run on real device then I am not able to see the result so can you tell me how can I see the result and from where I can get that sqlite file.
Short and Simple answer is "You Can't"
When you run on Simulator the generated applicationa nd Document files can be accessed in Library so you can easily check the sqlite file But
When you run on real device the sqlite file is in the document directory inside the device. and Apple does not allow to access the directory from device directly.
1)Enable Application supports iTunes file sharing when editing the info.plist file in Xcode
2)Connect your device to system then open iTunes then click device(such as iPad) then click apps in that you can see file sharing choose your app from that now you can see your sqlite file download that and open using firefox
If you are using Xcode version 6.1 the devices list has moved out of the Organizer. I was able to view the files for my app by:
Clicking Window->Devices and selecting my attached device on the left.
Highlight the application I wanted to view.
Click the settings gear icon below the list and select Download Container.
You are asked where you would like to save the container archive.
In Finder, left click the container archive and select view Show Package Contents.
Navigate to the file/folder you want to view.

how to locate the file which is saved in documents folder of the iphone

I am creating a file pdf in iphone application and it is saved in the documents it work fine on simultor i can also see the files.but how can i see this file when run the app on iphone device is there any way to get the file using itunes or any utility.
You can use Organizer.So example...
You can use itools.
1. Install itools
2. Connect your device with computer and open itools.
3. Go to "Apps" Tab, select your app.
4. Click on "document" icon,your app's document directory is opened.
5. Select the file and click "Export."
I know this is a late answer, but just in case it can help someone.
If you want to transfer a document from your ios app to computer, enable File Sharing in your app. Set the boolean flag “UIFileSharingEnabled” in your info.plist. Now when you connect the device and scroll to the bottom in the Apps page in itunes, there you can see all the files that are in your Documents folder in your app.

XCode app not syncing to itunes

I created an app on Xcode and synced it to iPhone and it works fine. Now, i want to sync the app to iTunes so that i can copy the ipa file and send it to someone else for testing.
But the app is not getting synced to iTunes.
Is there any way to get the ipa file?
My app uses sqlite database. Is that the reason for not getting the app synced?
Try this:
1) Build a app. And you will get a .app
2) Open iTunes
3) Drag and drop a .app to the iTunes at left panel on top. For truely drop, you must see a Green "+" about cursor when you are draged a .app on panel.
4) iTunes will convert your .app to .ipa file
5) Look at Users/{you}/Music/iTunes/iTunes Media/Mobile Applications folder and find your IPA app file
Hope this helps you
I think you're over thinking this one, instead of deploying to your phone then syncing back to iTunes, try archiving your app, then making an ad-hoc distribution. This will give you the IPA
Now, I'm not completely sure about this but Apple may have specifically put protocols in place to keep your from making your own ad-hocs your the way you described.
In xcode go to Product->Archive. After the Archive operation completes, go to the Organizer, select your archive, select Share and in the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution (which should match your ad hoc/app store provisioning profile for the project).

Looking into app folders inside iPhone device

Is there any way I can see the folder stricture for my app inside iPhone? I have installed a app in my iPhone and have dumped a file inside documents directory. I wanted to see what all data I have in this folder. Is it somehow possible?
use the Xcode organizer.

(iphone) access device's documents directory from mac?

I'm trying to access the documents directory at iphone device to see a log file that I saved while executing the app.
I know this can be done for simulator.
(you can browse the document directory of your app with Finder)
Can this be done for device?
Thank you
In Xcode 6 you should open Devices window to download it.
You can open Organizer in Xcode and download the documents directory when your device is connected right ?
I'm going to combine the two solutions together and add screenshots for clarity. This is with Xcode 7.
View/Download App Documents
Open the Devices window through the menu Window -> Devices.
Select your device.
Select your application.
Click the gear button for the options.
View/Download/Delete Documents through iTunes
IMPORTANT!!!
If you have documents within a subfolder, you will not be able to see or change them through iTunes.
Select the Info.plist file in the Project navigator.
Click the + button next to any property to add another.
Scroll down the list or type to find Application supports iTunes file sharing.
Change boolean value to YES.
Re-build/install application.
Hi Viraj's anwer is the way to go .Here is a screenshot:
iOS provides a framework to share documents between your application & iTunes. Check out the Core Services Layer section of the Apple docs, specifically the File-Sharing Support section. It explains how to do this:
Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.
Put whatever files you want to share in your application’s Documents directory.
On a side note, if this is just for debugging, you can always print logs using the default NSLog function and check the output using OS X's Console.
You also can use itunes for the same, but to view in itunes make change as below in your .plist
Add new key as "Application supports iTunes file sharing" and make it as boolen with value YES
With MacOS Catalina, Apple has made it very easy for reading the files written from the Documents directory.
Here are the steps:
Once the device is connected to the Mac, it should be listed under the 'Locations' section in Finder as follows:
Select the device. From the tab bar below the device details select 'Files'.
You will be able to see a list of apps that stored files to the Documents directory. Expanding each app will show the files with its document directory.
You can drag and drop these files to any location in the Mac for further use
One way can be to use iExplorer
Download link iExplorer