832

The keyboard does not show up when I run the simulator and click in the UITextView. How do I re-enable the keyboard?

It used to work but now it doesn't - I don't know what I might have clicked by accident.

5
  • 194
    Just press ⌘K it will toggle keyboard.
    – yazh
    Feb 12, 2015 at 13:08
  • 3
    You must have accidentally disabled it when you are trying to "clean" your code. :)
    – Gellie Ann
    Dec 21, 2015 at 8:20
  • 1
  • 2
    That's right, this issue appeared after I cleaned my Terminal window :) Thanks a lot for the tip!
    – Nekto
    Aug 17, 2017 at 0:55
  • 14
    Xcode 8 => ⌘+Shift+K
    – user5306470
    Nov 22, 2018 at 7:30

19 Answers 19

1332

I had the same issue. My solution was as follows:

  1. iOS Simulator -> Hardware -> Keyboard
  2. Uncheck "Connect Hardware Keyboard"

Mine was checked because I was using my mac keyboard, but if you make sure it is unchecked the iPhone keyboard will always come up.

8
  • 7
    Ironically they keyboard is there, if you change screen orientation you can see it hidden off-screen in the bottom corner as the frame adjusts size and reveals it for a split second... so when Apple has hardware keyboard enabled they actually just slide the keyboard just off-screen so that it's invisible. Interesting, I suppose they do this so that a UIInputAccessoryView still displays at the bottom of the screen. Jul 30, 2014 at 15:22
  • 5
    @AlbertRenshaw They keyboard is always there. any ios. It is just under the view bounds. You can play around with the views and you will find it there! The slide up animation is just pulling it up :) Aug 15, 2014 at 12:02
  • 8
    Actually, this is really a bug: when I uncheck Connect Hardware Keyboard I can't type using my Mac's keyboard. In pre-iOS 8 it didn't "simulate a hardware keyboard", it just allowed you to additionally type using your Mac.
    – pkamb
    Aug 20, 2014 at 17:03
  • 3
    @AlbertRenshaw somewhere in iOS6 docs (referring why DidUnload was removed) apple mention that a UIView structure doesn't take that much memory. Also having the keyboard in RAM is not an issue. You will use it over and over again. It is a speed gain, which is more important than a RAM gain! Aug 24, 2014 at 14:48
  • 3
    To fix this issue AND still be able to type with your real keyboard, see the answer by Aidan Melen
    – DonnaLea
    Mar 9, 2015 at 8:30
424

While testing in the ios8 beta simulator, you may toggle between the "software keyboard" and "hardware keyboard" with +K.

UPDATE: Since iOS Simulator 8.0, the shortcut is ++K.

5
  • 9
    actually your answer is great, and the only reason it doesn't show is because it's set to soft keyboard, and cmd+K will toggle the keyboard.. this answers the question, and it's great.. i wish i can give you +1000
    – Nour Helmi
    Aug 13, 2014 at 14:43
  • 3
    OMG, I just spent an hour on this thinking that becomeFirstResponder wasn't working!
    – SmileBot
    Sep 19, 2014 at 19:30
  • 8
    ⌘⇧K In Simulator v8.0(550.1)
    – beryllium
    Sep 25, 2014 at 18:50
  • 2
    this worked for me...but I don't remember when did I press ⌘K to disable the simulator keyboard....
    – iphondroid
    Sep 30, 2014 at 13:55
  • That's Golden! I hit the keystroke by mistake! And hmm! Have two simulator work in one and not the other! i'm glade i googled so quickly! After thinking a bit about it! Thanks! Gold Aug 5, 2021 at 21:44
102

Simulator -> Hardware -> Keyboard -> Toggle Software Keyboard should solve this problem.

Simulator->Hardware->Keyboard->Toggle Software Keyboard

2
  • 3
    Simple and best answer..+1 Nov 4, 2014 at 9:44
  • Your answer save me :) Vote +
    – core114
    Oct 25, 2018 at 8:31
61

This seems to be a bug in iOS 8. There are two fixes to this problem :

  1. Toggle between simulator keyboard and MacBook keyboard using the Command+K shortcut.

  2. Reattach keyboard to simulator :

    a. Open Simulator

    b. Select Hardware -> Keyboard

    c. Uncheck and then check 'Connect Hardware Keyboard'

Screenshot for step 2

OR simply press the Shift + Command + K shortcut

1
  • I agree that this seems to be a bug, at least as of Xcode 8.3.3. After I call endEditing, the keyboard intermittently ceases to appear even after I pop the view controller and reload it. Once I noticed that the behavior was intermittent, it became pretty clear that it's not something my code is doing (which is the case 99% of the time--most of the time when I think it's Xcode's fault, it's usually something I'm doing!). In this case I'm pretty certain this is an Xcode bug. Jul 15, 2017 at 14:38
50

To enable/disable simulator keyboard: click ⇧+⌘+K to show the keyboard on simulator, click again to disable (hide) the keyboard.

++K

OR

enter image description here

Simulator ->I/O ->Keyboard ->Toggle Software Keyboard

1
41

To enable/disable simulator keyboard,

⌘ + K (Ctrl + k)

To disable input from your keyboard,

iOS Simulator -> Hardware -> Keyboard -> Uncheck "Connect Hardware Keyboard"

37

You can use : ++K to show keyboard on simulator.

0
36

Just press ⌘K it will toggle keyboard.

18

In the new simulator Hardware option is removed,

If you want to find a Keyboard option manually, Then click on the I/O section,

I/O -> Keyboard ->Toggle Software Keyboard(⌘K)

enter image description here

16

This worked for me. Click I/O, then Keyboard. When the "Connect Hardware Keyboard" is deselected, then the simulator keyboard will popup.
enter image description here

13

It would be difficult to say if there's any issue with your code without checking it out, however this happens to me quite a lot in (Version 6.0 (6A216f)). I usually have to reset the simulator's Content and Settings and/or restart xCode to get it working again. Try those and see if that solves the problem.

0
9

To fix the problem follow this -

  1. Quit Xcode and simulator
  2. Press ‘command+shift+g’ .. it will open the “go to folder” dialog.
  3. type “~/Library/Preferences” in this dialog to go to your preference folder.
  4. Delete “com.apple.iphonesimulator.plist” in this folder
  5. Done. “com.apple.iphonesimulator.plist” will be regenerated when you start simulator again.

Alternatively you can also do this with just one command.

Open terminal and fire - 1. rm ~/Library/Preferences/com.apple.iphonesimulator.plist

This will do the trick in one step! Just make sure you quit Xcode and simulator before running this.

2
  • Thanks. Toggling Software Keyboard did not work for me. This one did!
    – TomV
    Oct 7, 2019 at 15:08
  • 1
    Great answer. + ten billion. Oct 27, 2019 at 4:48
8

If keyboard do not shown up automatically in simulator, just press [Command+K]

or Hardware -> Keyboard -> Toggle Software Keyboard

3

in viewDidLoad add this line

yourUiTextField.becomeFirstResponder()
3

DISCLAIMER: This is a very old question, but since other questions on this subject are getting closed as duplicates of this one, I thought it could benefit from an answer that puts all the updated options in one. Thanks to all who have contributed in answering!


If the iOS Keyboard ("Software Keyboard") does not show up while a text entry field (UITextField/TextField etc.) is focused, the cause are most probably the settings in Simulator.

There are 2 settings in Simulator menu:

  • I/O > Keyboard > Connect Hardware Keyboard ⇧⌘K

  • I/O > Keyboard > Toggle Software Keyboard ⌘K

enter image description here

Pre-XCode 8, the "I/O" menu was called "Hardware"

As you can see, each setting has their own keyboard shortcut. The first one controls if you can use your macOS keyboard for those field. The second controls the show/hide state of the iOS keyboard. If Hardware Keyboard is connected, Software Keyboard will be pushed out of view.

You don't have to Connect/Disconnect Hardware Keyboard each time you want to use it. Instead, keep it connected and whenever you need to use it, just type along (Software Keyboard will disappear), then push ⌘K to make Software Keyboard appear to judge your layout.


Additionally, in some edge cases where changing the 2 settings does not help, you may need to use:

  • Simulator menu Device > Erase all Contents and Settings ...
0
1

Simple way is just Press command + k

1

If the simulator's keyboard doesn't open by pressing ⌘K, reset the simulator to factory settings. go to Simulator's menu Device -> Erase all Contents and Settings.. It will resolve the keyboard not opening issue.

1

Using Script You can run via Xcode Pre Run Action

/usr/libexec/PlistBuddy -c "Print :DevicePreferences" 
~/Library/Preferences/com.apple.iphonesimulator.plist | perl -lne 'print 
$1 if /^    (\S*) =/' | while read -r a; do /usr/libexec/PlistBuddy -c 
"Set :DevicePreferences:$a:ConnectHardwareKeyboard false" 
~/Library/Preferences/com.apple.iphonesimulator.plist || /usr/libexec/PlistBuddy -c  "Add :DevicePreferences:$a:ConnectHardwareKeyboard bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist; done

enter image description here

1

enter image description here just.
uncheck connect Hardware keyboard

1
  • I really like when someone just provides solution. Aug 26, 2023 at 11:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.