how to see console logs on iphone? - iphone

I developed an applications on gps functionality.
I stuck up with some problem, i want to see the user location coordinates from the device.
I kept NSLogs wherever its required for me, if i connect the device to mac and if i run i
am able to see the logs in console,
But in my requirement i have to roam to some other other location and i need to get the logs.
how to get logs from device?
can we get these logs by writing them to any file?
if at all we are writing to any file, after connnecting the device to itunes how to get the file where i have writtern?
thanks in advance..... :)

Maybe the Organizer's console or device log can be "written" by the app and, when connect it, you can see it on the Organizer.
Another "low technology" solution is to save on disk the data (as a Plist) and show it into the app via UITable or UITextView.

Phone Configuration Utility lets you easily create, maintain, encrypt, and install configuration profiles, track and install provisioning profiles and authorized applications, and capture device information including console logs.
It is available for Windows and Mac.
For Windows: http://support.apple.com/kb/DL1466
For Mac: http://support.apple.com/kb/DL1465

I'm using this app ConsoleLog for iPhone

Related

Are logs made with NSLog or CCLog stored in the iPhone? Can I retrieve them?

When testing my iOS application on a device connected to Xcode, logs from NSLog or CCLog appear in the console, which is very useful for me to debug.
When the device is not connected to Xcode, obviously I don't get such logs. And when it crashes, I simply don't know why.
Because of this, I made a question here: Is there an output log like Xcode's available locally in my iPhone?. But I have noticed that those "Device Logs" are not the logs I expected. In fact, they are greatly different from the logs I see in my Xcode console, and none of them reflects a NSLog or CCLog I have done in my project. So I guess I was looking in the wrong place.
Are NSLogs or CCLogs stored somewhere I can retrieve? I don't really understand the "Device Logs", but they really don't seem to tell me anything useful or specific.
Connect your device to your computer and in XCode, windows Organizer, you can see the devices. You can select your device and then click on Console. It should show you all the NSLog statements
Your crashes are logged in your device so you can retrieve them when you connect your phone to the XCode.
1 - Plug it in
2 - Open you XCode and go to Organizer (cmd + shift + 2)
3 - Click on Devices and then on the upper left click on Device Logs.
To add something to the other (pretty standard) answers, here's a solution for which you don't need Xcode: the idevicesyslog utility from the libimobiledevice library can also display all logs.
Bonus: if you have a jailbroken phone, you can install syslogd from Cydia and all your syslog will be saved to a file named /var/log/syslog.
Best option is to run your app from Xcode connected to a real device and look at console output (Shift-Command-Y to display/hide console view by default).
Second best option is to connect device afterwards to your mac and use iPhone Configuration Utility to view your app specific console log.
Third best option is to use some 3rd party iPhone app, which can read console log in the device (when you're on field trip or something). Warning: I made the "Console On Device" app just for this purpose, needed to debug crashes while travelling. It can display app specific logs and allows emailing them.
In my experience, most users never look at logs, so they are useless and just waste time, space, and battery. Some people look at the logs and get worried for no good reason at all, give you bad reviews ("I looked at the logs and there are lots of bugs in the code"), all with no benefit to anyone.
So get rid of the NSLogs. Best to define a macro that does NSLog in a debug build and nothing in a release build. There shouldn't be any NSLog in your source code except for that macro.

How to view logs from iPhone?

I have place several NSLog() in my iOS application, is it possible to see all the logs later on my Mac that was generated when the app ran on iPhone handset even when iPhone was not connected with Mac.
Thanks
No. You can however redirect NSLog to a file, using something like this: http://blog.coriolis.ch/2009/01/09/redirect-nslog-to-a-file-on-the-iphone/
Then you can access the file via Xcode, or upload it with your app. File usage and privacy issues apply.
Keep in mind that NSLog is supposed to be turned off in published apps, so you may want to use a different logging app. A number of NSLog alternatives are available.
Unfortunately this is not possible.
The only thing that you can get is a Crash Log.
If you need a better logging system, I suggest to take a look to CocoaLumberjack, a very powerful logging framework that gives you the opportunity to save log in files and, eventually, send them to a server.
You also have many different levels like: log info, log error, log warning, etc...
You can view crash logs from your iPhone in the Organizer.
If you want to view your own log statements, you could consider TestFlight ( http://testflightapp.com ). They offer an SDK which includes features for remote logging.
I'm fairly certain that's not possible. The device needs to be connected to the Mac in order to run in Xcode's debug mode, and you need to be in debug mode to view the console, which contains your NSLogs.
There is a crash log for every crash that occurs on the phone, which is readable after connecting to your mac. These NSLog's don't appear in this log nor do they appear anywhere else in a (semi) permanent manner.
It's possible using custom macros and a custom class which will write each message in the documents directory in a file.
If the file sharing is enabled in the app you can later download them in iTunes.
Seeing the logs in mac might not be possible. But you can send the log to testflight using TFLog(). But you will need to distribute your app through testflightapp. And integrate the sdk. I think that is what you are looking for. try out - testflightapp.com

iPhone console for nslog?

How can i see nslog messages when I am testing on device? My only way right now is to have a UITextView and put message in there, there must be a better way..Thanks.
I went to seetings and turned on console but still don't know how to see them. Thanks.
These calls will output to your devices system log. You'll be able to get these from the XCode Organizer when you plug your phone back in.
There are also a few apps you can install from App Store on your device (search for free ones, with Console in their title, and ability to send emails with logs).
This is useful especially if you want to debug some errors on your beta testers devices, or don't want to connect your device every time you want to see what's in the console log.

Can I get console logs from my iPhone app testers?

I am testing my iPhone app with some people who install it through iTunes together with the mobile provision file that I give them. Apple has good instructions for how to get crash logs from these people, but is it also possible to get console logs from their devices? I do not have physical access to these people, otherwise I could connect their device to my computer and see the console log in Organizer. I would like to give them instructions to get me their console logs, but there doesn't seem to be a way?
Apple's iPhone Configuration Utility (available at http://www.apple.com/support/iphone/enterprise/ ) for both Mac and PC allows your users to capture log information and send it to you.
Use the iOS Console Kit from here

How can I get to installed app list on iPhone device?

I'm new for iPhone dev.
I got a question for development of iPhone app.
Is it possible to get to installed app list on iPhone device?
thanks.
Connect you device in your system, use following command in terminal
ideviceinstaller -l
you will get the list of app installed in you iphone device
note: you should install ideviceinstaller package in your system
Apps on a non-jailbroken phone are "sandboxed" so you don't get unfettered access to the filesystem. This means that you can't directly see what other applications are available. Also, just because they're installed does not mean that they are available to the current user. For instance, Safari is always installed but can be disabled in the Parental Controls settings.
The best supported (i.e., in a way that Apple will approve of) way of of doing it might be to check the available URL schemes. For example, if "http:" is supported then Safari is usable; if "mailto:" is available then Mail is usable, etc. Of course, not all applications have URL schemes.
You might want to grab yourself a copy of the Apple iPhone Configuration Utility, which will give you a list of installed apps, plus access to the console output from the iPhone.
Grab the iPhone configuration tool and run this regex on the Export:
[ \t]+<key>CFBundleDisplayName</key>[ \t\r\n]+<string>([A-Za-z \&\-,\!]+)</string>
You can then grab the list of apps nice and easily.
Here's what I did, without jailbreaking. (yes it sounds stupid, but it was simple and worked well for me)
Go to your home screen.
Hit the lock button + home button (takes a screenshot)
Open you folders and do the same.
Do the same for any other pages you have.
All the names of installed apps are now in your pictures folder, just copy the pictures to your computer, and finished!