How to copy and paste from a Mac into the iOS Simulator (and fix it)
Codemia Knowledge Hub ·
Copy the text on your Mac, then press Cmd+V while a text field inside the iOS Simulator has focus. When that fails, it is almost always one of three things: the simulator window does not have focus, the hardware keyboard setting is wrong, or the control in your app is not accepting input. The steps below isolate which.
The three layers a paste goes through
- macOS pasteboard stores the copied content.
- Simulator process bridges the macOS pasteboard to the simulated
UIPasteboard. - UIResponder chain in your app decides which control receives the paste.
A failure in any layer looks the same: nothing happens on Cmd+V. Finding the broken layer tells you what to fix.
| Layer | Symptom | Fix |
| macOS pasteboard | Paste fails everywhere, including macOS apps | Restart pboard process or reboot |
| Simulator bridge | Paste fails in all simulator apps but works in macOS | Reset simulator or restart Simulator.app |
| App responder chain | Paste works in Settings.app but fails in your app | Debug your responder chain and text field configuration |
Check paste in a system app first
Before touching app code, confirm the simulator itself can paste (about 30 seconds):
- Copy plain text from any macOS app (TextEdit, Notes, Terminal).
- Click the simulator window to bring it forward.
- Open the built-in Notes app or the Settings > General > About > Name field.
- Tap the field until the cursor appears.
- Press
Cmd+V.
If it works there, the clipboard bridge is healthy and the problem is in your app. If it fails even in system apps, the problem is the simulator.
Toggle the hardware keyboard
This setting is the most common cause. In the wrong state, key events from your Mac keyboard may not reach the simulator correctly.
Menu path: I/O > Keyboard > Connect Hardware Keyboard (or Cmd+Shift+K).
Toggle it and test again. Xcode versions differ in the default, and an Xcode update can change it. With a non-US keyboard layout, also check I/O > Keyboard > Use Same Keyboard Layout As macOS so key mappings match.
Edit > Paste works but Cmd+V does not
If Edit > Paste from the simulator menu works but Cmd+V does not, the clipboard is fine and keyboard routing is the issue:
- Menu paste goes through the simulator's menu responder chain and skips keyboard event dispatch.
Cmd+Vgoes through the keyboard pipeline, which other apps or accessibility features can intercept.
Check whether a screen recorder, keyboard manager or clipboard manager is grabbing Cmd+V globally.
Paste fails only in your app
When system apps paste fine but your screen does not, look at your UIKit code:
The control is not first responder. A UITextField must be first responder to receive paste. A gesture recognizer, parent view or custom input accessory view stealing focus makes paste fail silently.
The delegate blocks edits. If textField(_:shouldChangeCharactersIn:replacementString:) returns false, the paste is swallowed.
A canPerformAction override disables paste. Overriding it to hide the paste menu item also blocks Cmd+V.
Build a minimal screen to confirm the baseline:
If paste works here but not in your real screen, the difference lies in your view hierarchy, gesture recognizers or delegate logic.
Testing the clipboard bridge in code
Read and write UIPasteboard directly:
nil on read-back means the simulator-to-host bridge is broken. If it works but UI paste fails, the responder chain is the problem.
SwiftUI text fields
SwiftUI TextField and TextEditor paste through the same UIPasteboard bridge. If only SwiftUI fails, check for a .disabled(true) modifier or a custom onPasteCommand handler that swallows the input.
Resetting the simulator
When paste fails in every simulator app:
- Quit Simulator completely (Cmd+Q, not just closing the window).
- Reopen it and test again.
- If still broken, use Device > Erase All Content and Settings.
- Restart Xcode if the run destination state is stale.
Do the full reset last: it removes every installed app and its data from that simulator.
Paste in XCUITest
The host clipboard is not reliably synced across CI agents, so tests that depend on Cmd+V are flaky in CI. Prefer deterministic text entry:
If you must test paste, set the pasteboard inside the test process instead of relying on the host clipboard:
Easy-to-miss causes
- The simulator window does not have focus. Click it before pressing
Cmd+V. - Debugging app code before checking paste in a system app like Notes.
- The Hardware Keyboard toggle changed after an Xcode update.
- UI tests that rely on host clipboard state pass locally and fail in CI.
- A
canPerformAction(_:withSender:)override disables paste on a custom text control. - A macOS clipboard manager intercepts
Cmd+Vbefore it reaches the simulator.
Related reading
- Copy text to clipboard with iOS
- Copy to clipboard using Javascript in iOS
- Cordova start specific iOS emulator image
- Core Data background context best practice
- Core Data Quickest way to delete all instances of an entity
- CoreBluetooth XPC connection invalid
- CoreData warning Unable to load class named
- Correct way to load a Nib for a UIView subclass
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.