390

I sometimes get this message in the logs of Xcode 8b3 when running my app, everything seems to work, but I'd like to know where this comes from. Google did not help at all.

allenh
  • 6,582
  • 2
  • 24
  • 40
swalkner
  • 16,679
  • 31
  • 123
  • 210

6 Answers6

286

in your Xcode:

  • Click on your active scheme name right next to the Stop button
  • Click on Edit Scheme....
  • in Run (Debug) select the Arguments tab
  • in Environment Variables click +
  • add variable: OS_ACTIVITY_MODE = disable

screenshot

Ed.
  • 3,923
  • 1
  • 15
  • 18
190

It comes from +[UIWindow _synchronizeDrawingAcrossProcessesOverPort:withPreCommitHandler:] via os_log API. It doesn't depend from another components/frameworks that you are using(only from UIKit) - it reproduces in clean single view application project on changing interface orientation.

This method consists from 2 parts:

  1. adding passed precommit handler to list of handlers;
  2. do some work, that depends on current finite state machine state.

When second part fails (looks like prohibited transition), it prints message above to error log. However, I think that this problem is not fatal: there are 2 additional assert cases in this method, that will lead to crash in debug.

Seems that radar is the best we can do.

Roman Ermolov
  • 7,898
  • 5
  • 27
  • 35
  • 1
    Can you ,please, elaborate on tools, which you used for debugging to get this private method name and its structure? – Oleksandr Karaberov Oct 19 '16 at 14:23
  • 9
    @AlexanderKaraberov you may use Hopper Disassembler to find warning text in framework binary and references to this text from private method. – k06a Nov 02 '16 at 14:04
  • I also get this when the keyboard scrolls in and I have a controller subscribed to respond by resizing its views. – yo.ian.g Aug 02 '17 at 18:56
83

Try putting the following in the environment variables for the scheme under run(debug)

OS_ACTIVITY_MODE = disable
Sampath
  • 63,341
  • 64
  • 307
  • 441
Nick Peachey
  • 1,059
  • 6
  • 2
  • I got this in the simulator when rotating the iPhone 7 using the hardware->rotate menu items. This environment variable made the spurious message go away. – George D Girton Sep 19 '16 at 23:32
  • Where are environment variables? – Erika Electra Oct 16 '16 at 00:17
  • 1
    The answer from @Foo below is useful because it includes the how-to details. – Kevin Owens Nov 06 '16 at 14:25
  • 1
    It also not print the constraint warning log – Chirag Shah Nov 30 '16 at 06:14
  • 36
    OP asked where the message comes from. Just saying how to silence it is not the right answer. – iCaramba Dec 11 '16 at 20:29
  • Indeed, this adjustment is a subject to NSLog output disappearance, consequently returning upon deleting _OS_ACTIVITY_MODE = disable_ from the **environment variables**. This observation was made earlier in some other posting. – matrix3003 Dec 14 '16 at 17:34
  • 6
    The "IOS_ACTIVITY_MODE = disable" answer turns off ALL logging! Just close the logging view if you don't want to see the log. Really ridiculous answer, amazing that it has so many votes! Does nothing to address the actual message. Our apps that heavily use core data work fine, these messages and others started appearing after one of the last Xcode updates. Sad that Apple can't resolve these type of issues. – John Jul 26 '17 at 14:07
13

We can mute it in this way (device and simulator need different values):

Add the Name OS_ACTIVITY_MODE and the Value ${DEBUG_ACTIVITY_MODE} and check it (in Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).

enter image description here

Add User-Defined Setting DEBUG_ACTIVITY_MODE, then add Any iOS Simulator SDK for Debug and set it's value to disable (in Project -> Build settings -> + -> User-Defined Setting)

enter image description here

Igor
  • 12,165
  • 4
  • 57
  • 73
  • Didn't work for me: I'm also seeing this in the console, despite already having disabled the debug activity mode as suggested above. – Johan Jun 03 '18 at 00:46
-1

To fix, I deleted the app from Simulator.

I also ran Clean first.

I do not think anything orientation-related triggered it. The biggest thing that changed before this symptom started is that a Swift framework started calling NSLog on worker threads instead of main thread.

Jeff
  • 3,829
  • 1
  • 31
  • 49
  • 1
    Doing a clean worked fine at first for me when I ran it in the simulator without rotating it, but then soon as I tested again with a rotation command, it reported the same error. – cheznead Jul 25 '17 at 15:00
  • I am using pan gestures and only get this error when changing orientation. – Jeremy Andrews Aug 01 '17 at 08:58
-8
OS_ACTIVITY_MODE = disable

This will also disable the ability to debug in real devices (no console output from real devices from then on).

franiis
  • 1,378
  • 1
  • 18
  • 33
kindaian
  • 147
  • 1
  • 2