While trying to capture a screenshot on Xcode V12.0.1 - the app screen turns to "Home screen" (of IOS) and a screenshot on the home screen is prodcued instead of the app screen.
It was working fine a week before, but my OS and Xcode were auto updated last week to MacOS 10.15.7 and Xcode V12.0.1 and since then i am unable to take screenshots of the simulator.
Press Command+Shift+4 and then keep the mouse pointer on Simulator and then press "Space Bar" key one camera icon will appear, now left click the mouse. Your simulator screen shot is saved on desktop. You can take the screen shot any small screen in the same way.
If you take a screenshot from within your app running on the simulator, and then save it to photos app on that simulator, then it is stored in some library folder of that specific Simulator.
To launch a Simulator without running an app Launch Xcode. Do one of the following: Choose Xcode > Open Developer Tool > Simulator. Control-click the Xcode icon in the Dock, and from the shortcut menu, choose Open Developer Tool > Simulator.
For taking a screenshot, I usually launch an app in the Simulator and press ⌘ - command + s or File > New Screen Shot. The screenshot will be saved to your Desktop. xcrun is a tool Apple provided to run any tool inside Xcode from the command line. To take a screenshot with xcrun. Run your app in the Simulator.
xcrun is a tool Apple provided to run any tool inside Xcode from the command line. To take a screenshot with xcrun. Run your app in the Simulator. Enter the following command and hit ⏎ Return.
Click the Run button to build and run the app on the selected simulated or real device. View the status of the build in the activity area of the toolbar. If the build is successful, Xcode runs the app and opens a debugging session in the debug area.
I ran into this issue and as of now I can only provide a work arround - Use command line to take the screenshot
xcrun simctl io booted screenshot Screenshot.png
Firstly, this problem still happens (at least, for me) in Feb 2021 with Xcode 12.3.
Secondly, I was running Xcode and the simulator on an older (slow) Mac mini, so doing something like xcrun simctl io booted screenshot Screenshot.png
worked for me too, but it took over 30 seconds from pressing "enter" to when the snapshot was captured, so by then the simulator screen had changed (I was trying to get a screenshot of the launch image). I suppose with careful timing, to use the command 30 seconds or so before the time the simulator is displaying the desired screen, is one way, but tricky and error prone.
Thirdly, I tried restarting Xcode, after quitting the simulator as well, and it worked for me. It seems to have a good chance of working when Xcode is first started, although later the "home screen" bug appears to surface for some unknown reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With