How do you access the all of the NSLog statements? - ios

I have an application which is producing an error very intermittently, I am trying to run it down with an NSLog statement in swift. However, after I have noticed the bug has occured, when I hook up my iPhone to review the logs in the Devices window. I only see about 5 minutes worth of statements from various applications. Is there a way to get the history past what automatically comes up? Is there a way to get your applications NSLog statements only?

I haven't tried it from Swift, but we sometimes use NSLogger from Obj-C. It will log to a local Mac application instead of the console on the device. Alternatively, we sometimes log to a file and then transfer the file via email.

You can take a look at Bugfender, it's a product we have built to solve this problem. We had the same problem, especially when delivering beta apps to our customers, so we decided to make a product to solve this problem.
With Bugfender you will be able to get the device logs without any need to connect the device to your computer.
It's easy to integrate and you can choose which devices you want to get the logs from. Our service works offline and online, we have spent a lot of time to make it reliable and easy to use.

Related

Is there way to get the stack trace of an iOS device that running your app?

I have an iOS app that I side-loaded to 5 of my testers onto their phones.
1 of them reported that the app is crashing, but I can’t seem to reproduce it.
He also can’t seem to reproduce it either.
Is there way to get the stack trace of an iOS device that running your app?
Is there away that he can sent his logs to me via email or some kind of cloud service like Firebase?
Should I look into any technology?
If you get the person to bring their phone to you, you can plug it in to XCode and read the logs that way, however, you won't be able to go back and view logs from days past. But, if they plug in and run the app and are able to recreate the crash, then you'll have it right there.
It is possible to write code in your app to write log data to a file that you save on your phone. To keep from filling up your phone storage, I delete that file when the app is closed and create it new when the app is started. Then, I created a method in the app to contact support, and I attach the log file to the e-mail. This works great as long as they click the contact support button before closing out of the app. However, if the app crashes, then you could code it to keep the log file if it already exists on the next startup.
Keep in mind that once you start sending the log data to a file, it will no longer show up in your console when you are debugging your app, unless you code some sort of easy switch to flip to turn that feature on or off.

Access to iOS device's console output

Is there an iOS app which allows to look at console output created by another iOS app?
My app has several NSLog() calls which output precise timings. I would like to test the app, when it is not connected to my development Mac, and look at timings after that, possibly still on my iDevice using some other "console browser" app.
Is that possible?
So the way to do this is to use the Apple System Logger which allows you to access the logs and you can then display them on screen. NSLog will be logged to this. I wrote something a few years ago so that testers could test the app and open the log and view it on the device.
Its a bit tricky to use the interface and there is a limit, I think it was 200, on the number of logs in the cache, so log only the necessary stuff.
After a quick search, I found this - SOLogger which should help you.

How can I get live console output when device is connected to another hardware device?

So I'm trying to make an application using the DJI SDK. In order for my app to function properly, my iDevice needs to be hooked up to the remote controller of the drone via USB.
This means I can't also run the app via xcode and get console output.
Is there a way of saving console output when using an app on your phone? I am aware of the crash logs, but sadly they don't provide enough info to be useful to me.
This problem started when I got a runtime error only when the device was connected to the remote controller. Therefore there was no way of isolating the problem since I couldn't tell what went wrong.
Another solution would maybe be a 1 female to 2 male usb chord, but I haven't found one online yet and even if I did I don't know if that would work.
Is there a standard way of debugging when using hardware that needs to be connected to the device?
from Xcode, hit window on the tool bar at the top, then Devices. Select the device you want to read the log from. However, this is the log for the entire phone, and you have to be plugged into the mac... so you'll have to run your tests, unplug from the DJI, plug into the mac, go to devices, and scroll through the log until you find the output from your app, and you won't be able to see real time expected outcome.
It's not ideal, but that's the only way I know of to see the apart from building an entire console log into your app yourself.

How to get crash logs of Testflight external testers on Xcode or iTunes connect?

Is there any ways to know what's wrong with someone's app. It is working on everyone else's device but this person.
The person tried removing the previous version and installing the new one, but it still does not work. I suspect that one of the files that I place in the documents folder might still be there... but the format of this file has changed since...
Apple has a technote about this named Debugging Deployed iOS Apps.
Also, if your tester syncs up their iPhone with a Macintosh or PC, iTunes also helpfully moves logs into predictable places where they can be retrieved from.
I am attempting to solve this logging of execution in TestFlight with the following simple approach...
In in-App Billing you really have to use TestFlight, so the problem is serious.
The "print("text") statements can be replaced in the code to calls to a func printTestFlight(text: String) which writes the strings to a database along with some identifier so you know the user.
This is quite simple and obvious, and to an extent it works.
If there are events which are logged by the os rather than teh user, then this approach misses those, notably the interesting ones around a crash. I'd be happy to hear from anyone who knows how to do thiso

Debugging - Capture The State Of An iOS App

My app has a bug, which I am unable to replicate when it is run when plugged into the computer.
I see it three times a day and it is quite annoying.
Is there any way to capture the state of the app (when not connected to the computer) and see what's going on? Kind of like what XCode does when you use a breakpoint, but somehow send the data to it (or some order tool that I am unaware of) wirelessly.
UPDATE:
The app does not crash. It's just that certain UITableViewCells don't work as they should at certain times.
Try using Crashlytics its awesome for crashes. You should also use TestFlight which will give you live sessions/logs of your app. These both combined will tell you many things.

Resources