140

Has anybody else had issues with the Xcode 8 console showing a bunch of random stuff? I don't want to have all of this cluttering my debug messages and logs. Does anybody know how to turn this off?

EDIT: The release notes specify that the console might dump unhelpful stuff for watchOS, but not for iOS.

Example: example of garbage in console

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
ellman121
  • 1,815
  • 3
  • 16
  • 24

2 Answers2

221

You can disable that output with a environment variable.

In Product>>Scheme>>Edit Scheme...>>Run add the following environment variable: Name:OS_ACTIVITY_MODE, Value: disable

Originally described on Twitter here.

enter image description here

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
melbic
  • 11,988
  • 5
  • 33
  • 37
  • 25
    It will also disables the normal NSLog information when using a real device. – Golden Sep 20 '16 at 03:40
  • 3
    is that means that in order to disable the output with an environment variable we need do this in every project? is there any shortcut that we could do it to all projects once for all? – Sherwin Sep 26 '16 at 21:26
  • NSlog still works for me @Golden - this solution is good – user1709076 Oct 05 '16 at 18:22
  • 1
    Same problem on my device, what should I do? @Golden – zy.liu Oct 11 '16 at 07:52
  • 2
    But how to disable the same on a device? I mean the logs from a real iPhone or iPad shown in Window -> Devices menu? Very often, we need to see the logs of a distribution/production app installed on a device (non-debug mode). – Prabu Arumugam Oct 17 '16 at 15:41
  • This has been fixed by Apple in Xcode 8.1 (on macOS Sierra) - no need for any environment variables! – jt_uk Nov 01 '16 at 22:29
  • 3
    @Sherwin - no offense, but one thing you learn with time is that Apple don't give a crap to developers. Just see Xcode and iTunesConnect, both a disgrace. – Duck Dec 02 '16 at 22:17
  • Flag or no flag, this does not work with my iPhone 7 Plus, iOS 10.2, Xcode 8.2. Getting lots of "AppleBiometricSensor" crap. – Jonny Dec 14 '16 at 07:43
  • 1
    This is not a good answer despite so many people upvoted it and has a green tick. NSLog gets filtered as well if you use this method. – GeneCode Dec 17 '16 at 09:15
  • Not works for real devices – jose920405 May 23 '17 at 16:56
  • Still getting logs in 8.2, I'm on El Capitan – Dixit Patel Jun 06 '17 at 07:42
  • 1
    This solution will hide all NSLog starting with Xcode 9. To keep NSLog, replace `disable` with `default`. – Cœur Sep 27 '17 at 19:11
  • You should use ASL (Apple system logger) and New console app where you can easily hide\show different log sources. See [this answer](https://stackoverflow.com/a/39581193/991816) – DanSkeel Oct 26 '17 at 14:33
  • As Coeur says, replacing disable with default works to reenable NSLog to console. But how then to filter out all the noise again? – Alyoshak Nov 14 '18 at 17:17
2

It seems this information is not garbage and can help with the variables view when checking system framework calls. However, this seems more related to debugging for the engineers at Apple and seems to have been logged as an xcode 8 issue. No idea when this will be resolved.

I also checked (started) the key binding with a "show" and "display" filters but none are relative to this. Below is apple's note:

• Xcode Debug Console shows extra logging from system frameworks when debugging applications in the Simulator. (27331147, 26652255).

triple7
  • 542
  • 3
  • 17
  • 5
    Meanwhile filter by a a tag, in Swift, you can modify print: `public func print(items: Any..., separator: String = " ", terminator: String = "\n") { let output = items.map { "*\($0)" }.joinWithSeparator(separator) Swift.print("YOUR_TAG:" + output, terminator: terminator) } ` – Martin Romañuk Aug 24 '16 at 18:00
  • @MartinRomañuk - where/how are you doing this modification? – KMLong Sep 14 '16 at 15:52
  • Just add an extension.swift with the previous content inside. Edit: You can drop it in any place of your code – Martin Romañuk Sep 14 '16 at 17:56
  • 5
    Still an issue in Xcode 10. :-( – Baxissimo Oct 03 '18 at 19:55