I am working on an app in SwiftUI in Xcode 12.2.
I have accidentally deleted the Automatic Preview Tab. I cannot seem to find the option to bring it back. Here is a screenshot of my Xcode:
Where do I enable the Automatic preview and bring it back so I can see real-time updates of my UI?
An easy way to find it is from the menu "Editor > Canvas"
In your Xcode snapshot, there is a button the top right corner with a bunch of horizontal lines. Click it and then click Canvas and the preview should come back. FYI, the preview canvas is different than a Storyboard, which is what you included in the "What I want" image.
Anyone can explain why the other menus in xcode are not being displayed? I downloaded a tutorial file and it only shows
and not as I would expect this
I am looking for the Capabilities tab,
Presumably, you're looking at a project:
and not a target:
Use the popup menu (or the sidebar that's shown collapsed in my screenshots) to select your app target instead.
I can't able to either import a .crash file or drag and drop the .crash file in Devices -> Logs area in XCode 6.3.. Really confused with this.. Any idea would be greatly appreciated.
GO to the Xcode and click Window -> Devices Menu
Then select your device after that you can see search bar in left bottom side
Then you can see uparrow button near by search bar that will open the Logs area of your app.
After clicking the Build/Run button on a project, the main window of Xcode loses focus. There is some configuration setting in order to avoid this behaviour?
This can be configured in Xcode Preferences Behaviors.
Be aware that Apple has some bizarre ideas of what view should be displayed including sometimes displaying the code of another project in the build tab.
I want to take a screenshot of my iOS application when it is running in the simulator, and save the screenshot on my Mac. How can I do this?
It's just as simple as command+s or File > Save Screen Shot in iOS Simulator. It will appear on your desktop by default.
An update with Xcode 11.4 simulator
To capture a screen shot, click on 'Camera' icon/action button, on the top bar of simulator.
OR
Select Save Screen Shot menu item, from File menu.
File => Save Screen Shot
Use ⌘ + S to capture a screen shot.
(Use window + s, if you are using windows/non-apple keyboard).
See for more details: How to change simulator scale options with Xcode 9+.
Tip 1: How do you get screen shot with 100% (a scale with actual device size) that can be uploaded on AppStore?
Disable Optimize Rendering for Window scale from Debug menu, before you take a screen shot.
Here is an option
Menubar ▶ Debug ▶ Disable "Optimize Rendering for Window scale"
Tip 2: Where is screen shot saved (Default Path)? How to change default path?
Simulator saves screen shot file on (logged-in user's) desktop and it's default path.
To change default path (with Xcode 9+), press and hold ⌥ Option (alt) button from keyboard, while you take a screen shot. Or
Using Mac Keyboad: Press keys ⌥ Option + ⌘ + s all together.
It will show to a dialog with file storage options and also allows to set/change default path.
Tip 3: How to take a screen shot with Device Bezel?
Enable Show Device Bezel from Window menu.
Here is an option
Menubar ▶ Window ▶ Enable "Show Device Bezel"
Now,
Press ⌘ + shift + 4 + Spacebar, all together in Mac Keyboard. (A window snap capture mode will become active)
Select Simulator window/frame, that you want to capture. It will save screenshot with device bezel (with shadow effect in background) on (logged-in user's) desktop.
You can also remove the Simulator toolbar as described here.
on iOS Simulator,
Press Command + control + c or from menu : Edit>Copy Screen
open "Preview" app, Press Command + n or from menu : File> New from clipboard
, then you can save command+s
For Retina, activate iOS Simulator then on menu:HardWare>Device>iPhone (Retina)
and follow above process
Command + S
is the way to save on Desktop, (on new iPhone simulators, this was introduced in later 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.
You can google for IOS Simulator Cropper software useful for capturing screen shots and also easy to use with various options of taking snapshots like with simulator/without simulator.
Update
Just pressing CMD + S will give you screenshot saved on desktop. Pretty easy huh..
Since Xcode 8.2, you can also save a screenshot with the following command:
xcrun simctl io booted screenshot
Further information in this blog: https://medium.com/#hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f#.bzuaf5gp0
Focus simulator
Go to menu File->Save Screen Shot
or
Press ⌘+S
Screen shot saves in desktop
Simple answer with sample answer ;-)
on iOS Simulator,
Press Command + control + c or from menu : Edit>Copy Screen
open "Preview" app, Press Command + n or from menu : File> New from clipboard , then you can save Command + s
UnCheck Alpha
You can change Image dimension to your requirement.
Here is the Final Image,For example
For some reason the commands posted before dont work for me, but this one does:
xcrun simctl io booted screenshot screenshot.png
Running Xcode 9.2
First, run the app on simulator.
Then, use command+s, or File -> Save Screenshot in Simulator to take necessary and appropriate shots.
The screenshots will appear on your desktop by default.
2020 Latest Update: XCode 11.4
Click on the camera icon above simulator to capture screenshot and save to your camera roll
Another option:
File > Save Screen from simulator
For people using Xcode 11.4, to get rid of the simulator top bar, this is far from ideal but you can disable shadows for the screenshot application in a terminal with the following command :
$ defaults write com.apple.screencapture disable-shadow -bool TRUE; killall SystemUIServer
Then, you can use ⌘ + ⇧ + 4 and select the simulator to take a screenshot. Without the shadow, you can easily crop the top bar with the preview app. To re-enable the shadow for the screenshot application :
$ defaults write com.apple.screencapture disable-shadow -bool FALSE; killall SystemUIServer
Source of this answer here.
In OSX Captain its a bug to take screenshot of simulator. You have to Update your OSX Sierra first then your are able to take. while taking in OSX Captain use terminal command which is xcrun simctl io booted screenshot.
before running this command u have to select desktop in terminal like:
"cd desktop" then run that command. Happy Coding!!!
Screenshot with device frame
Step - 1
Open quick time player
Step - 2
Tap new screen recording
Step - 3
Select Capture selected window
Step - 4
Cursor point on the simulator. It will automatically select the whole simulator like
Step - 5
Screenshot will open using preview. save it.
Here is some sample screenshot
Click CMD+SHIFT+4.
Put mouse over Simulator.
Press SPACE to select whole Window.
Press ALT+Enter to capture simulator window with no shadow.
Remove top bar from screenshot in GIMP or double click on screenshot preview to edit.
I found no way to hide top window bar and screenshot nice phone image with shadow. Apple rox ;-)
Press ⌘S or go to File > Save screenshot from your simulator menu and you will get the screenshot saved on your desktop.
First method:
Select simulator and press "command + s" button. Screenshot saved on desktop.
Second method:
Select simulator and go to "File > New Screenshot". Screenshot saved on desktop.
In case using XCUITests automation :
XCUIApplication().buttons["Add"].screenshot()
XCUIApplication().table["names"].screenshot()
API details : https://developer.apple.com/documentation/xctest/xcuiscreenshot
If you want to attach the device frame to your screenshot, use
xcrun simctl io booted screenshot shot.png && curl -F 'file=#shot.png' "https://shot.withfra.me/new"
It uploads the screenshot to a third party (WithFrame) that adds the device frame.
More info can be found here
Taking Screen Shot in IOS Simulator is SO Simple.
When you Open Simulator In the Right Lift You See File.
Click On File And You See Option Save Screen Shot.
This Option Saves Your Screen Shot In Default Path Which is Desktop.