Xcode 8.2 simulator crash and quits on saving a screenshot while debugging

杀马特。学长 韩版系。学妹 提交于 2019-11-29 06:02:32

问题


I updated my Xcode to 8.2 and since then if I try to take a screenshot while debugging it is crashing and then quits.

I tried iOS 9.0 and 10.0 simulators and it happen with both of them.'

Thanks

Update:

8.2.1 - Doesn't works

8.3 - Works only with Mac OS Sierra


回答1:


Please try this approach for taking screenshot

You can take videos and screenshots of Simulator using the xcrun Xcode command-line utility. To take a screenshot, run the command xcrun simctl io booted screenshot. To take a video, run the command xcrun simctl io booted recordVideo <filename>.<file extension>. (9887264)

source :Xcode 8.2 Release Notes

Simulator can crash when saving a screenshot when running on OS X El Capitan. (29182710) The crash does not occur on macOS Sierra.




回答2:


There is a nice simple way around it.

  1. In the simulators menu go edit->copy screen.
  2. Then open "Preview" and press cmd+n (New from Clipboard).
  3. Export - give it a name and enjoy your lovely screenshot.



回答3:


Yeah, unfortunately, this is tripping over a bug in Foundation on OS X 10.11. You won't have the problem if you upgrade to macOS Sierra.

If you cannot upgrade to Sierra right now, you can still take screenshots from the commandline:

xcrun simctl io booted screenshot <path to output file>

This is mentioned in the Xcode 8.2 Release Notes

Simulator can crash when saving a screenshot when running on OS X El Capitan. (29182710) The crash does not occur on macOS Sierra.




回答4:


For a static screenshot, an easier and faster workaround is to type COMMAND+SHIFT+4, then hit the space bar until the simulator window is selected, then click on the simulator window to save the screenshot.



来源:https://stackoverflow.com/questions/41125344/xcode-8-2-simulator-crash-and-quits-on-saving-a-screenshot-while-debugging

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