The reason:

The output log information is visible when the APP is running (machine audit) and can be used as a comparison aspect

To verify this, create a new Xcode project called logDemo and add an OC output to the viewController.m class viewDidLoad method

- (void)viewDidLoad {NSLog(@"log test info "); [super viewDidLoad]; // Do any additional setup after loading the view. }Copy the code

1. Run

View the Xcode Log output

2. Run the app directly on an iOS device

Yeah, just click on the demo icon

3. Open the Mac console App

Look like this. The Mac system comes with a lot of stuff

4. Select the iOS device connected to the MAC in the upper left corner and view the device

After running the app installed on the device, the log output of the console APP contains the log information output in the code!

At this time the old drivers may think of ——–

Custom NSLog method, set the debug mode to print logs

For example:

#ifdef DEBUG
    #define NSLog(...) NSLog(__VA_ARGS__)
    #define debugMethod() NSLog(@"%s", __func__)
#else
    #define NSLog(...)
    #define debugMethod()
#endif
Copy the code

Burn goose:

If developers can turn it off, I’m sure Apple will be able to turn it on.

Well, removing log printing is the most radical solution!

Note that the logs that need to be removed are not limited to the NSLog output of OC.

The log output of all the languages used in the project, such as swift, lua, C++, C#, etc., should be noted.

For this reason (since manual annotation is boring and disgusting…) , I have added the function of removing NSlogs in the tool. Currently, it is limited to removing nslog-related logs. It is a tool to obfuscate OC, to remove logs in other languages, I feel you are making it difficult.

I wish a happy holiday in advance

This article uses the article synchronization assistant to synchronize