Search code examples
iosiphoneios-keyboard-extension

Keyboard extension works in simulator but not on device


I am developing custom keyboard extension. It worked fine in both simulator and device until now.

After some small changes (adding import AudioToolbox in one class and one command) it suddenly stopped working on the device. The app compiles and runs but then I acivate my keyboard XCode shows following error:

Lost connection to "My iPhone".
Restore the connection to "My iPhone" and run "xxx.xxx.xxx.xxx-Keyboard" 
again, or if "xxx.xxx.xxx.xxx-Keyboard" is still running, you can 
attach to it by selecting Debug > Attach to Process > xxx.xxx.xxx.xxx-Keyboard.

This error looks like the one that appears when iPhone cable is unplagged but the cable is all right in this case.

My keyboard itself is not launched - when activated (using globe key) there is few seconds delay (which is normal when my keyboard is loading in debug) and then the previously active keyboard is shown.

There are month of development in that project and I am completely stack so any help is very much appreciated.


Solution

  • Solution that worked for me:

    • unplaged iPhone cable
    • Cleared project
    • Closed XCode, restarted computer
    • built project and all linked libraries from scratch
    • Restarted iPhone, deleted app containing keyboard extension, restarted iPhone
    • reconnected iPhone cable, run extension