Error: Protocol not available, dumping backtrace [duplicate]

守給你的承諾、 提交于 2019-11-27 10:42:56
Ankit Goyal

I found the solution as follows:

  1. In XCode menu, Go to Product > Scheme > Edit Scheme
  2. Open the Arguments tab
  3. Add the Environment Variable :- OS_ACTIVITY_MODE is disable

There's no SO_NOAPNFALLBK socket option in man socket. I guess, this option is added by Apple and is related to push notifications services, which are not available on simulator.

A cleaner solution (than the one given by Ankit Goyal) that fixes Simulator logs without affecting Device logs is available at https://stackoverflow.com/a/39651073/1033581:

  1. Under Product > Scheme > Edit Scheme... > Run, set the OS_ACTIVITY_MODE environment variable to ${DEBUG_ACTIVITY_MODE} so it looks like this:

  1. Go to your project build settings, and click + to add a User-Defined Setting named DEBUG_ACTIVITY_MODE. Expand this setting and Click the + next to Debug to add a platform-specific value. Select the dropdown and change it to "Any iOS Simulator SDK". Then set its value to "disable" (Xcode 8) or "default" (Xcode 9) so it looks like this:

To turn off Verbose for OS Activity Mode, You simply go to (in Xcode Menu Bar)

  • Product -> Scheme -> Edit Scheme-> Run (Left) -> Select Arguments -> On Environment Variables,

  • add OS_ACTIVITY_MODE and value as disable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!