159

After updating to Xcode 9, using Swift 3 and the iPhone X simulator, my console is full of:

TIC Read Status [11:0x0]: 1:57
TIC Read Status [11:0x0]: 1:57
TIC Read Status [11:0x0]: 1:57
...

What is that and how do I fix it? Help is very appreciated.

PS: I prefer not to just "silence" it with an Environment Variable in the build scheme.

6
  • 1
    Possible duplicate of stackoverflow.com/questions/40226104/… Sep 21, 2017 at 20:37
  • 5
    well. i have found this thread as well. but it's osx, old and not really answered...
    – David Seek
    Sep 21, 2017 at 20:39
  • did u find a solution yet ?
    – Kodr.F
    Jan 16, 2018 at 9:45
  • 2
    the annoying thing is not that this logs into console, but it also seems to hang the main thread
    – Hogdotmac
    Feb 13, 2018 at 10:03
  • 1
    yes it does. but only in debugging mode as far as i noticed.
    – David Seek
    Feb 13, 2018 at 15:15

7 Answers 7

183

Apple staff gave the following answer:

TIC expands to “TCP I/O connection”, which is a subsystem within CFNetwork that runs a TCP connection

1 and 57 are the CFStreamError domain and code, respectively; a domain of 1 is kCFStreamErrorDomainPOSIX and, within that domain, 57 is ENOTCONN

In short, a TCP read has failed with ENOTCONN.

As the TCP I/O connection subsystem has no public API, you must necessarily be using it via some high-level wrapper (like NSURLSession).

source: https://forums.developer.apple.com/thread/66058

EDIT/UPDATE:

Since we are all still having these annoying logs, I asked to the same Apple specialist from the above link about our situation, which is now specific for Xcode 9 and Swift 4. Here it is:

A lot of people are complaining about these logs, which I am having as well in all my apps since I upgraded to Xcode 9 / iOS 11.

2017-10-24 15:26:49.120556-0300 MyApp[1092:314222] TIC Read Status [55:0x0]: 1:57  
2017-10-24 15:26:49.120668-0300 MyApp[1092:314222] TIC Read Status [55:0x0]: 1:57  
2017-10-24 15:26:49.626199-0300 MyApp[1092:314617] TIC Read Status [56:0x0]: 1:57

His answer:

It’s important to realise that this ENOTCONN does not necessarily mean that anything has gone wrong. Closed TCP connections are expected in all versions of HTTP. So, unless there’s some other symptom associated with this error, my recommendation is that you ignore it.

source: https://forums.developer.apple.com/message/272678#272678

SOLUTION: Just wait for newer versions/updates of Xcode 9.

6
  • 30
    This is not specific to Swift. I am getting it with Objectiv-C as well. Jan 21, 2018 at 17:57
  • 8
    You really went above and beyond to get this answer
    – G. LC
    Sep 13, 2018 at 22:34
  • 7
    Your solution seems not to have worked, since it's still there in XCode10. Oct 25, 2018 at 11:57
  • 2
    we have to find a way to get rid of this, because log printing affects the app performance during runtime, for now we can hope, that for non #DEBUG builds this will not get printed
    – Stoyan
    Oct 25, 2018 at 15:25
  • 6
    would be nice have some settings, so we could actually "ignore it" Dec 14, 2018 at 11:01
41

Here is how TIC Read Status [11:0x0]: 1:57 breaks down:

TIC expands to “TCP I/O connection”, which is a subsystem within CFNetwork that runs a TCP connection

11 is a connection ID number within TIC

0x0 is a pointer to the TIC object itself

1 and 57 are the CFStreamError domain and code, respectively; a domain of 1 is kCFStreamErrorDomainPOSIX and, within that domain, 57 is ENOTCONN

Source: https://forums.developer.apple.com/thread/66058

8
  • okay. so far so good. is that something bad or just an information? do i need to fix anything?
    – David Seek
    Sep 21, 2017 at 21:03
  • I believe it has something to do with iOS11.0 and might be fixed in future releases
    – 0rt
    Sep 21, 2017 at 21:20
  • 8
    But why is it actually happening? And why did it suddenly start with iOS 11? Oct 3, 2017 at 18:24
  • I am getting a tones of them too in my log but all my network calls are working fine :L
    – user8193429
    Oct 4, 2017 at 10:46
  • The same problem what i must do with this?
    – Genevios
    Oct 13, 2017 at 16:02
35

Note: Like what @David mentioned in the comment, it's a way to hide the warnings, so use this launch argument to avoid getting many repetitive messages and have a clean console. Once done debugging, keep it disabled as console doesn't provide useful information when it's enabled. For example libc++abi.dylib: terminating with uncaught exception of type NSException.

For people who are wondering how to silence the warning and until a better fix is available you may keep following variable handy and toggle as needed.

Use OS_ACTIVITY_MODE = disable environment variable under Arguments in the product schemes to avoid console getting flooded with such warnings.

Note B: Enable it to see the effect.

Source: https://medium.com/@adinugroho/disable-os-logging-in-xcode-8-ec6d38502532

enter image description here

2
  • 13
    Also I have literally said, that I do not want his option ^^ Just silencing it doesn't get rid of the problem.
    – David Seek
    Oct 12, 2017 at 5:15
  • 23
    People need to stop suggesting disabling all log statements. Answers like this should be deleted. Nov 30, 2018 at 13:01
6

The best way I found, concerning this log message and some others ( like NSURLSession errors that are not necessarily errors ) is to have my own log functions.

class Logger {
    static var project: String = "MyProject"

    static func log(_ string: String, label: String = "") {
        DispatchQueue.main.async {
            print("[\(Logger.project)] \(label) : \(string)")
        }
    }

    static func info(_ string: String) {
        Logger.log(string)
    }

    static func warning(_ string: String) {
        Logger.log(string, label: "WARNING")
    }

    static func error(_ string: String) {
        Logger.log(string, label: "ERROR")
    }
}

Then I simply type [MyProject] in the console pane bottom-right filter, and that's it.

Note that by calling print on the main queue, it allows your logger to be used from threads without mixing up your console.

Ready to be improved and tweaked for your needs :)

1
  • check "os_log" . this is way apple recommend to use with advanced logging Jul 31, 2019 at 10:09
0

I was having this same issue where I was getting '}' in response to a REST(GET) service.

Using:

URLCache.shared.removeCachedResponse(for: request as URLRequest)

after making my URL request, and resetting my URLSession object after getting the response as:

session.reset(completionHandler: {
  // print(\(data))                          
})

Solved my problem.

1
  • 1
    Will not solve my issue as this even happens if all my App does is calls to Firebase. And I can't manipulate the framework. But I will forward this to Firebase dev team. Maybe they can do something about it.
    – David Seek
    Jun 20, 2018 at 14:23
0

We manage to solved this logging problem by disabling HTTP/2 on the web server, in our case we have migrated from classic ELB to application ELB that added support to HTTP/2 on AWS and we started getting "TIC Read Status [11:0x0]: 1:57" on XCode 10.1 / iOS 12 console. This looks like a temporary solution until Apple fix the problem with HTTP/2 if any. This solution may not work for everybody, specially if you are using third party APIs, but it gives you some insights on the problem.

1
  • 4
    Well it has been 1.5 years now since Apple introduced this... let's call it... feature... I don't see this being "fixed" any time soon.
    – David Seek
    Mar 20, 2019 at 5:18
0

It's a logging indicating that a TCP connection is lost/closed/not_valid or whatever. This can happen if your app has a running tcp-connection and the app is put in background for some time, or you turned off the screen of your phone. The OS decides to stop as much resources as possible to reduce battery drainage. If you bring the app to foreground, the tcp-connections you had before, won't work anymore. You need to recreate a new tcp-connection.

If it doesn't bother you, just ignore it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.