Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12.0.1 Screenshot is capturing only Home-screen on iOS simulator

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.

enter image description here

like image 921
SriTeja Chilakamarri Avatar asked Oct 12 '20 11:10

SriTeja Chilakamarri


People also ask

How do I take a screenshot on iphone 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.

Where do IOS simulator screenshots go?

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.

How do I use Iphone simulator in Xcode?

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.

How do I take a screenshot in the Xcode 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.

How do I take a screenshot with xcrun?

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.

How do I debug an app in Xcode?

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.


2 Answers

I ran into this issue and as of now I can only provide a work arround - Use command line to take the screenshot

  • cd to the folder that you want save the screenshots to.
  • Run xcrun simctl io booted screenshot Screenshot.png
like image 142
humblePilgrim Avatar answered Sep 25 '22 21:09

humblePilgrim


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.

like image 28
auspicious99 Avatar answered Sep 23 '22 21:09

auspicious99