Refresh iPhone simulator with hardware keyboard disconnected - ios

i'm testing a react-native iphone app on the xcode iphone simulator. i don't think this is a react-native specific problem, but included that info in case it's relevant.
i'm trying to create a page that autofocuses a TextInput when it loads, with the keyboard visible. Now, in order to get the simulator to auto-show the keyboard when a text input gains focus, I have to disonnect the hardware keyboard.
the catch is that with the hardware keyboard disconnected, i can no longer Cmd+R to refresh the app, which I have to do manually whenever I have an error.
is there some other way to refresh the simulator when the hardware keyboard is disconnected?

First right click your Simulator
Then Press Hardware
Press Shake Gesture
enter image description here
finally disable Live Reload
enter image description here

You can enabled live reload from the debug menu which causes the application to reload every time you make changes to the javascript.
https://facebook.github.io/react-native/docs/debugging.html

In order to get the simulator to auto-show the keyboard when a text input gains focus, I just use the emulator option Hardware > Keyboard > Toggle Software Keyboard.
I only toggle it once and keep the hardware keyboard connected, which allows me to do cmd + r and have the best of both worlds.
I can cmd+r as much as I want and the soft keyboard will still show up.

Related

Disable iOS Simulator auto focus when running the app

I'm getting this warning on the console all the time:
console warning
I figure out that happens when I press any key on my keyboard and the focus is on the Simulator's device.
The problem is that when I run the app on Xcode the focus goes to the Simulator and every key that I type on my keyboard counts as an input to the Simulator's device because the focus is on it. Is there a way to prevent the auto focus on running the app on Xcode?
I found a similar question, but back them there was no answer telling if it's possible to do it on Xcode.

How to permanently turn off Auto-Correct in iOS Simulator?

I am trying automated tests using Appium.
Every time Appium launches , it resets the properties of Simulator.
Launch iOS Simulator.app and then select the device you want to boot.
From the home screen, launch Settings. Select General, then Keyboard. In the Keyboard Settings, disable Auto-Correct:
You can turn-off autocorrection in your computer, that is
System Preferences -> Keyboard -> Text
This should turn off autocorrect everywhere in that specific computer.
Now, if you don't want to turn it off everywhere, you can go to the attributes inspector for each textfield and turn it off.
Just enter numbers instead of letters and you won't have that problem.

Can the software Keyboard toggle on the iOS Simulator always be toggled on?

I'm testing an app using KIF and every time the test starts I have to manually toggle the software keyboard on and short of using a script to make it turn on is there a way to turn it on by default when the simulator opens?
No, it's not something that can be stuck on or off. The behavior is exactly like a bluetooth keyboard connected to a physical device. As there is no "always on" toggle for the real case, there is likewise no "always on" toggle in the simulator case.
The toggle/shortcut in the sim menu behaves just like tapping the eject key on a physical keyboard/device.
The key for us was two-fold
Make sure "Connect Hardware Keyboard" is checked. By default, when
you click into a text field, this prevents the software keyboard from appearing.
Press Cmd+K to toggle the software keyboard. If it wasn't appearing before, it will appear now.
Once you've done the above leave the sim in that state. This state is the most easy to work with because you can type using the hardware keyboard and the software keyboard will appear so KIF will work.

iPhone 6 simulator, hide keyboard issue

Does the iPhone 6 have some new way (off-screen/hard button) to reopen a hidden soft keyboard? I don't have a physical device to test with, but I'm seeing something new in the iPhone 6 simulator that I don't see in iPad or iPhone 5.
The iPhone 6, in landscape view, now has a "hide keyboard" button, like only iPad has had before. Here are the different behaviors I'm seeing, and I'm hoping it is not a new issue I need to design my apps around.
Initial steps are the same in iPad and iPhone 6 simulators (and tested on physical iPad and works same as simulator):
Switch to landscape orientation
Open Calendar app (probably other apps too, but wanted to give example using native app, it happens in my app also which is why I care)
Tap + to add a new event
Tap in a text field
Tap the "hide keyboard" button in bottom-right corner
Tap to another text field
On physical iPad and iPad simulator the keyboard reopens at this point. With iPhone 6 simulator, the keyboard doesn't reopen.
I've tried some different combinations of resignFirstResponder and becomeFirstResponder in my app to try to get it to reappear, but nothing is working. Because the Calendar app also has this issue I'm hoping it isn't actually an issue, and there is a way for the user to reopen the keyboard manually if they want? In the simulator I can use "toggle software keyboard" and it reopens, but not sure if the physical device has something that lets the user reopen the keyboard?
If I switch to another app, or the home screen, after that the keyboard does start working as expected again (tap a text field and it opens).
Try unchecking Hardware => Keyboard => Connect Hardware Keyboard.
Try these keys to open soft keyboard => Command + K

Possible iOS Bug with VoiceOver and Onscreen keyboard use

I found what I believe to be a bug in iOS 5.1. It seems like it's specifically on 4S devices. I was really hoping some other iOS developers with Wireless keyboards could test this out. If you find that it is a problem, please submit it as a bug report. This particular issue is very important to a project I'm working on and I would appreciate any community support on this issue.
The Bug Report:
This bug allows the on-screen keyboard to appear even when the Apple Wireless Keyboard is connected (without any prompting from the keyboard's eject key). The problem occurs after the keyboard has been paired and VoiceOver is activated.
Steps to Reproduce:
Make sure that VoiceOver can be turned on via tripple pressing the home key. VoiceOver should be turned off initially. Pair the keyboard to the iPhone 4s running iOS 5.1. Turn the keyboard off so that the on-screen keyboard is the only form of text input. Do the following:
Enter any app's text field (I was able to reproduce the bug on the home screen's "Search iPhone" search bar).
Turn the wireless keyboard on. The on-screen keyboard should disappear as it's supposed to.
Tripple press the home button to activate voiceover. The on-screen keyboard comes back.
Expected Results:
The on-screen keyboard should not appear.
Actual Results:
The on-screen keyboard appears and keeps appearing every time another text field is accessed (regardless of being connected to the wireless keyboard).
Regression:
iOS 5.1 on iPhone 4s
Notes:
If step 1 is taken with VoiceOver initially turned on, then step 2 will still happen as it is described. From that point, if VoiceOver is turned off, the on-screen keyboard does not return so long as the wireless keyboard is connected.
This bug makes designing apps to work specifically with the wireless keyboard and VoiceOver very difficult. The on-screen keyboard appears at inappropriate times and consequently gets in the way of VoiceOver's sequential screen navigation as well as gesture recognition.

Resources