在XCode中運行react-native 的時候,避免不了的要查看日志信息 ,但是react-native中的Socket的日志簡直是太多了,往往是剛看到自己想要看到的信息的時候,瞬間就被最新的日志給刷上去類似:
nw_socket_handle_socket_event [C5255.1:1] Socket SO_ERROR [61: Connection refused] nw_socket_handle_socket_event [C5255.2:1] Socket SO_ERROR [61: Connection refused] nw_connection_get_connected_socket [C5255] Client called nw_connection_get_connected_socket on unconnected nw_connection
看着像是Error 但是對自己程序的運行沒有影響,解決掉這個打印:
點擊 product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment Variable
添加 Name : OS_ACTIVITY_MODE ; Value : disable