If your keyboard (mac keyboard) is not working in the iPhone simulator you must have something wrong in iPhone Simulator preference file.
To fix the problem follow this –
0) Quit Xcode and simulator
1) Press ‘command+shift+g’ .. it will open the “go to folder” dialog.
2) type “~/Library/Preferences” in this dialog to go to your preference folder.
3) Delete “com.apple.iphonesimulator.plist” in this folder
4) 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 –
This will do the trick in one step! Just make sure you quit Xcode and simulator before running this.