Xcode 8.2 simulator crash when save screen shot

前端 未结 6 1295
温柔的废话
温柔的废话 2021-01-30 01:37

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

相关标签:
6条回答
  • 2021-01-30 01:41

    So an easier workaround is this:

    1. Run app in simulator (obviously)

    2. In simulator go to Edit>Copy Screen

    3. Open Preview app
    4. Go back to simulator and save screenshot i.e. File>Save Screenshot

    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.

    0 讨论(0)
  • 2021-01-30 01:42

    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.

    0 讨论(0)
  • 2021-01-30 01:43

    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.

    0 讨论(0)
  • 2021-01-30 02:00

    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>

    0 讨论(0)
  • 2021-01-30 02:06

    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

    0 讨论(0)
  • 2021-01-30 02:07

    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:

    0 讨论(0)
提交回复
热议问题