After update XCode 8.2, every time save simulator screen shot always made it crash. Even I reset content and settings still crash.
Should I remove all simulator and inst
So an easier workaround is this:
Run app in simulator (obviously)
In simulator go to Edit>Copy Screen
Done!
Not sure why this prevents the bug from occurring but it worked for me. It's faster than all the other methods described above.
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.
Please find the below steps for getting the screenshot.
1) Go to Simulators -> Edit -> Copy Screen or you can use the shortcut (ctrl + cmd + c).
2) Open the Preview and go to File -> New from Clipboard or you can use the shortcut (cmd + n).
3) Now go to File -> Save or you can use the shortcut (cmd + s).
Or you can also refer the below GIF presentation.
Solution 1
1) Go to Simulators > Edit > Copy Screen (⌃⌘C)
2) Open Preview App > Go to File > New from Clipboard (⌘N) and Save (⌘S) to your favorite location on your machine
Solution 2:- Using the xcrun Xcode command-line utility
Open Terminal App
and run the following command to take screenshot
xcrun simctl io booted screenshot
If you wish to save the captured screenshot to specific location
xcrun simctl io booted screenshot <path_to_output_file>
Another convenient way -> Shift+Command+4 - tap the space bar, tap on the window to get snapshot of the Simulator's window.
https://support.apple.com/en-us/HT201361
The crash seems to occur due to a segmentation fault, or more specifically a general protection fault, while calling the saveScreenShot:
selector. Why it happens can depend on several things, so it's hard to say whether a reinstall would help.
In any case, if the screenshot (⌘S) function in simulator causes the crash, there's hardly anything you can do about it. The best option you have is probably to file a bug report to Apple.
Update:
I just updated to the 8.2 GM, and low and behold, ⌘S crashes for me as well. Although I'm getting KERN_INVALID_ADDRESS
instead of EXC_I386_GPFLT
.
One workaround, for the time being, is copying the screen and pasting into Preview: