how to see NSLog in my SDK project under iOS 10

1.3k views Asked by At

I have a SDK project which will compile and build a framework. Inside this project, I have my person NSLog shown there. I have another framework test app to using this framework to do my task. After upgrading to iOS 10 and Xcode 8, I notice all the NSLog are gone. I cannot find it anywhere.

I search and find this answer: iOS 10 doesn't print NSLogs, I gave a try for both my SDK project and my framework test app, adding OS_ACTIVITY_MODE "disabled", however, it is still not showing NSLog.

Update: I still have one device which is iOS 9, I gave a try on that one, NSLogs are still shown in device console. Using Mac's console app I can also see my own logs.

This is a MFI project so I cannot directly debug this project, because the lighting cable is always connected with my hardware. I can only use log to see what happened.

3

There are 3 answers

0
ventayol On

Apple did some changes the way NSLog works and I probably you might not be able to get them.

My recommendation is that you change your NSLog to something that prints to the output console without using NSLog.

I'm the co-founder of a product called Bugfender that might help you, what we do is that we provide a BFLog function that will print the logs to the console and also upload them to our servers, so you can always check the logs without any need to connect the device to your computer.

The only problem our product has is that it's not in real time, but usually there's a delay of a few seconds. Some of our customers are using it to debug the app instead of using the XCode console.

1
TianGeng On

enter image description here

If you set this,you can not see any log in your device ,but you can see that in simulator.

0
dahiya_boy On

OS_ACTIVITY_MODE set as disable remove OS activity state which is printed during the when project is runs. OS_ACTIVITY_MODE is only printed only in the x-Code 8.0 but when you upgrade your x-codefrom 8.0 to 8.1 you can found that it does not print any console for OS. But in overall procedure I have found that NSLog is working properly.

For your confirmation i just update my old project and run it into x-code 8.1. Output as below images

Environment variable

enter image description here

Nslog Code

enter image description here

console print

enter image description here

Suggestion

I have checked your problem in multiple style with multiple project but I didn't found any problem. So I just suggest you

  1. To update your x-code or
  2. Re-install x-code after removing previous x-code completely.

Because If it is x-code bug them i also have to face the same in my every experiment.

If you still have any query you can ask.