NSLog doesn't work with NetworkExtension

Hi all!


I'm developing an app extension with NetworkExtension framework, everything is working fine,

but NSLog seems not working for me, I have searched a lot of information but still cannot solve,

Is there a way to solve my problem?


thanks!

Answered by DTS Engineer in 125693022

Xcode can only catch

NSLog
output when it launched the process. In the case of an app extension, like a Network Extension provider, Xcode doesn’t launch the process, so it can’t see the output from
NSLog
.

The output from

NSLog
is always visible in the system log, which you can view in Xcode (Window > Devices).

Finally, IMO it’s important to implement a comprehensive logging strategy within your Network Extension provider. You will need this to when it comes to debugging problems that only show up in the field. So, while it’s fine to use NSLog for initial bring up, you don’t want to rely on that in your final product.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

Xcode can only catch

NSLog
output when it launched the process. In the case of an app extension, like a Network Extension provider, Xcode doesn’t launch the process, so it can’t see the output from
NSLog
.

The output from

NSLog
is always visible in the system log, which you can view in Xcode (Window > Devices).

Finally, IMO it’s important to implement a comprehensive logging strategy within your Network Extension provider. You will need this to when it comes to debugging problems that only show up in the field. So, while it’s fine to use NSLog for initial bring up, you don’t want to rely on that in your final product.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for your answer, I got it.

NSLog doesn't work with NetworkExtension
 
 
Q