ios 8 how to debug Custom Keyboard? - ios

I have successfully created a Custom Keyboard with Swift on iOS 8 simulator.
Although it worked well, but I could not debug it. It is a contained target and was installed through Settings->General. Placing a bookmark in XCode not work.

I am able to debug a custom keyboard using the simulator via Xcode 6.
Select the keyboard (and not it's container) as the scheme.
"Run" and then select on of the apps on your simulator to debug the extension with.

It seems as of now apple didn't get support for debugging extension into simulator. I was having same issue but I observe that We can debug code if we execute application into device as below.
1) Choose your Keyboard extension target.
2) Go to Edit Scheme.
3) In info tab select your Executable from drop down and check the option "Debug extensions and XPC services".
Still several problems are there like we can't see output of NSLog but you can check the value of variables same as before or I suggest you to check this link It may work for displaying NSLog output KeyboardViewController NSLog IOS 8.

Apple has reported this problem as a know issue in Xcode 6.1 release notes:
Localization and Keyboard settings, including 3rd party keyboards, are not correctly honored by Safari, Maps, and developer apps in the iOS 8.1 Simulator. [NSLocale currentLocale] returns en_US and only the English and Emoji keyboards are available. (18418630, 18512161)
I'm using Xcode 6.1.1 and seems that it still hasn't been solved but I've discovered a workaround. You should follow this steps:
Open Xcode and in its menu bar click into Xcode > Open Developer Tool > iOS Simulator
Now into iOS Simulator menu bar go to Hardware > keyboard and check if "Connect Hardware Keyboard" is enable. If it is, click it to disable and quit iOS Simulator
Then go back to Xcode and make sure that keyboard is selected as scheme
Click into run button or press Product > Run to build and run you application and in the "Choose an app to run" menu choose Today
When iOS Simulator starts, go to Settings > General > Keyboard > Keyboards > Add New Keyboard and select your own and then press in your keyboard command + shift + H to back to the homescreen
Finally open Calendar app and press the magnifying glass icon, the keyboard will appear and you only need to hold the globe button to show the list of enabled keyboards and select yours
Note that it's important to try your keyboard in the Calendar app because in most applications it doesn't work or it has an unexpected behavior
If the keyboard still doesn't appear:
remove the file com.apple.iphonesimulator.plist from ~/Libray/Preferences/
In iOS Simulator menu bar click into iOS Simulator > Reset Content and Settings...
More info about keyboard debugging and development here

After searching and investigating this, I've found the best solution to be to install and use Reveal. It helps you visualise the custom keyboard like the debug hierarchy view and shows various other measures.

Related

Disable Debugging in Expo For React Native App

So I've opened up my react-native app in Expo today (using the iOS simulator) and I am creating by what looks like a debugging overlay.
Screenshot here:
I don't need this and it's blocking some of the UI for testing.
How does one turn it off?
You have the Element Inspector open. To toggle it off do either:
⌘+D if you are in the simulator
Shake your phone if you are on an actual device
This should open up the debugging menu. You can then click on Toggle Element Inspector to close it.

React Native 0.47: Reload on iOS device

react-native-cli: 2.0.1
react-native: 0.47.1
react: 16.0.0-alpha.12
I finally managed to hook up an iOS device (iPhone 4S) to xcode and build my react native code to the device.
Shaking the phone gives me the following options:
as you can see there is no Live Reload option and the Reload doesn't work. I am forced to build it from xcode every single time I make a change.
Can anybody help me getting the Reload to work and enable Live Reload?
I have struggled with this for many days now - because it seems to change all the time and the only answers I have been able to find are obsolete.
Could the issue be that my iPhone runs iOS 9.3.5? _____
Had the same issue here, and fixed it like that:
Make sure wifi is disabled on the iDevice
Open System Preferences by selecting System Preferences from the Apple menu, or by clicking the System Preferences icon in the Dock.
When the System Preferences window opens, click the Sharing preference pane.
The left side of the Sharing preference pane lists the services that you can share. Place a check mark in the Internet Sharing box.
Then Check "USB YourDevice/iPhone/iPod/iPad"
You are Done! (working here on v0.47.1)
Check that you can access internet/network on your device, then run your app form XCode in Debug mode. Now, you should have the green bar on top loading from the packager and you can debug remotely.

Unable to select my custom keyboard from the available keyboards list

I'm developing a custom keyboard app for iOS devices. After adding keyboard extension to my app I added a TextView to Main.storyboard and then I ran my app on an iPhone 5 simulator.
For adding my custom keyboard to available keyboards list I went to Settings > General > Keyboards > Add new Keyboard & here I added my custom keyboard but when I'm returning back to my app and trying to select my custom keyboard by long pressing the globe icon, my custom keyboard has not been shown there.
What's the matter here?
Please reply & I'm sorry for no code as I haven't coded any yet.
Thanks in advance
Please neglect the mistakes!
There is a bug concerning the simulator.
Either you run your extension on a real device or you can use the Photo app or Safari browser of the simulator to test your extension.
general article about developing iOS keyboards (head for “The Simulator”)
As of Xcode 6.1, you can no longer open 3rd party keyboards in most apps in the Simulator, including your own. (And not just 3rd party keyboards: most system keyboards refuse to show up, too.) Not only does this make debugging a whole lot harder, but it also prevents you from easily making screenshots of your keyboard if you don’t own some of the newer devices. This issue is marked as a bug in Radar, and seeing as how it first appeared in the Xcode 6.1 betas, I cannot fathom how it got through to release.

iOS 7 iPad Guided Access Text Areas dont show keyboard

For the life of me I cant figure this out - please help me :)
Basically I'm hoping to use some ipads as a kiosk solution to gather data in public areas however whenever I enable guided access mode and tap a textArea the soft keyboard doesnt show up. Heres the steps:
Goto Settings > General > Accessibility > Guided Access > Enable
Goto Safari > Open Google.com > Triple tap the home button > Resume
Incorrect Behaviour:
Tap the search screen > No keyboard shows
I've tested this with a "New" iPad (last of the old dock connector models) & iPad Air on 7.0.6
Also tested on iPhone 5S on 7.1 and it seems fine (so two variables there)
Can anyone confirm/deny my thoughts it may be a bug
That is a bug in iOS 7 versions below 7.1. With iOS 7.1 automatically showing the keyboard when selecting an input textfield worked as well as the "hide keyboard" button when resuming guided access while the keyboard is visible.
I'm not aware of a workaround for this behavior for iOS 7 versions before iOS 7.1.

How can I choose an iOS simulator as the destination in Xcode?

I am an iOS noob. I had a project running on the iPhone simulator in Xcode 4.4. To resolve a different issue, I un-installed 4.4 and then installed 4.5.1. Now when I try to run my project on the simulator I get an error "Xcode cannot run using the selected device: No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination."
How do I choose an iOS simulator as the destination?
Where do I click?
There should be a menu in the top left region of the toolbar section of the IDE. It should have a run button, a stop button, and then the name of your app and a label saying IOS Device. Click view-->show toolbar if you don't see it. Click on IOS Device and you should get a drop down menu of devices. The simulator should be in that list.
This should do it, its very simple actually
Just in case anyone finds this helpful --
Sometimes your version of xCode doesn't support the deployment targets.
My iOS simulator did not show up as a destination until I set the deployment target down to 7.0 (it seems like 7.1 may not be supported by xCode 5.0, but only 5.1 [not confirmed]).
Hope that helps if anyone stumbles across it.
For me the problem was that the selection in the toolbar only shows up for a certain width of the XCode window
I was able to add devices to the Simulators list by clicking on Window->Devices (Shift+Command+2), and clicking on the + at the bottom left to add Simulators.
After you click on Create, the device(s) will show up
Make sure to set Supported Platforms correctly
I had the same issue. The simulator would run a different device than chosen in the size field under "Simulated Matrix".
I dug around and found in Xcode's menu: Product/Destination. screenshot I was then able to run the simulator for the correct size.
Hope this helps !!

Resources