What should I do with "Warning: sync SCNetworkReachability (by-name) query on main thread"

Hello,


we recently started to use a mobile device farm to test our Apps. After the tests are run logs of every device can be accessed.


There I found several lines like

2015-09-15 17:50:07.000 WARN:  My-Aps-Name[86259] <Warning>: Warning: sync SCNetworkReachability (by-name) query on main thread


Here someone suggests not to do network requests on startup. So I moved necessary request(s) from application:didFinishLaunchingWithOptions: to applicationDidBecomeActive:. But with no apparent effekt. I still find these log messages.


I couldn't find anything else regarding these messages. Has someone knowledge on how I get rid of this warning (a part from launching all network requests from an extra thread, which I think shouldn't be necessary, because the App in question does not launch so many requests.)?

And how "bad" is it to have this warning, if there is no sensible way of eliminating the cause?


The iOS version of the test-devices is 8.3.

The App is build to support 7.1 to 9.1. A version build for 7.1 to 8.4 showed no difference.


Thanks in advance!


Best regards,

gabriel

This warning is a sign of a very real problem. Under the right (well, wrong :-) circumstances it’s quite possible for your app to be killed by the watchdog, as described in QA1693 Synchronous Networking On The Main Thread.

Let’s start with the big picture issue: why are you doing reachability queries at all? This is not just me being nosy (-: The vast majority of apps that I see using reachability are using it for the wrong reasons.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
What should I do with "Warning: sync SCNetworkReachability (by-name) query on main thread"
 
 
Q