Ios_webkit_proxy_driver is crashing/closing

I have a hybrid app that requires me to log in using FB. When I click on sign up with fb, fb page opens up and the app crashes. See the attached log.

[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [RemoteDebugger] Executing ‘find_element’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var l=this;functi…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:“Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘23’
[debug] [RemoteDebugger] Received result for atom ‘find_element’ execution: null
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element 500 516 ms - 164
[HTTP] --> POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element {“using”:“id”,“value”:“register-social-facebook”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“register-social-facebook”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [RemoteDebugger] Executing ‘find_element’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var l=this;functi…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:“Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘24’
[debug] [RemoteDebugger] Received result for atom ‘find_element’ execution: {“ELEMENT”:”:wdc:1489586191100”}
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“5012”}
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element 200 507 ms - 90
[HTTP] --> GET /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5012/displayed {}
[debug] [MJSONWP] Calling AppiumDriver.elementDisplayed() with args: [“5012”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘elementDisplayed’
[debug] [RemoteDebugger] Executing ‘is_displayed’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var h,l=this;func…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:"Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘25’
[debug] [RemoteDebugger] Received result for atom ‘is_displayed’ execution: true
[debug] [MJSONWP] Responding to client with driver.elementDisplayed() result: true
[HTTP] <-- GET /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5012/displayed 200 510 ms - 76
[HTTP] --> GET /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5012/enabled {}
[debug] [MJSONWP] Calling AppiumDriver.elementEnabled() with args: [“5012”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘elementEnabled’
[debug] [RemoteDebugger] Executing ‘is_enabled’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var g=this;functi…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:“Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘26’
[debug] [RemoteDebugger] Received result for atom ‘is_enabled’ execution: true
[debug] [MJSONWP] Responding to client with driver.elementEnabled() result: true
[HTTP] <-- GET /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5012/enabled 200 508 ms - 76
[HTTP] --> POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element {“using”:“id”,“value”:“register-social-facebook”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“register-social-facebook”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [RemoteDebugger] Executing ‘find_element’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var l=this;functi…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:“Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘27’
[debug] [RemoteDebugger] Received result for atom ‘find_element’ execution: {“ELEMENT”:”:wdc:1489586191100”}
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“5013”}
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element 200 511 ms - 90
[HTTP] --> POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5013/click {“id”:“5013”}
[debug] [MJSONWP] Calling AppiumDriver.click() with args: [“5013”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘click’
[debug] [RemoteDebugger] Executing ‘click’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var k,aa=this;fun…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:"Runtime.evaluate…
[debug] [RemoteDebugger] Receiving WebKit data: {“result”:{“result”:{“type”…
[debug] [RemoteDebugger] Found handler for message ‘28’
[debug] [RemoteDebugger] Received result for atom ‘click’ execution: null
[debug] [MJSONWP] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element/5013/click 200 510 ms - 76
[HTTP] --> POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/elements {“using”:“id”,“value”:“register-next”}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: [“id”,“register-next”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘findElements’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [RemoteDebugger] Executing ‘find_elements’ atom in default context
[debug] [RemoteDebugger] Sending javascript command (function(){return function(){var l=this;functi…
[debug] [RemoteDebugger] Sending WebKit data: {“method”:"Runtime.evaluate…
[debug] [RemoteDebugger] WebKit remote debugger socket disconnected
[debug] [iOS] Error received while executing atom: operation timed out
[MJSONWP] Encountered internal error running command: TimeoutError: operation timed out
at afterTimeout (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/timers.js:16:15)
at Timeout.timeoutTimeout [as _onTimeout] (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/timers.js:59:9)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/elements 500 5013 ms - 190
[HTTP] --> POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element {“using”:“id”,“value”:“home-menu”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“home-menu”,“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [iOS] Error received while executing atom: Remote debugger is not connected
[MJSONWP] Encountered internal error running command: Error: Remote debugger is not connected
at WebKitRemoteDebugger.executeAtom$ (lib/remote-debugger.js:317:87)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at WebKitRemoteDebugger.executeAtom (lib/remote-debugger.js:321:14)
at XCUITestDriver.callee$0$0$ (…/…/…/lib/commands/web.js:305:29)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at XCUITestDriver.callee$0$0 [as executeAtom] (…/…/…/lib/commands/web.js:305:14)
at XCUITestDriver.doFind$ (…/…/…/lib/commands/web.js:177:26)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at doFind (…/…/…/lib/commands/web.js:176:13)
at XCUITestDriver.callee$1$0$ (…/…/…/…/lib/basedriver/commands/timeout.js:93:24)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at XCUITestDriver.callee$1$0 (…/…/…/…/lib/basedriver/commands/timeout.js:89:23)
at spin$ (lib/asyncbox.js:108:15)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:294:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:167:17)
at exp (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/core-js/library/modules/$.def.js:38:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:166:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:192:12)
at spin (lib/asyncbox.js:112:15)
at waitForCondition$ (lib/asyncbox.js:121:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:294:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:167:17)
at exp (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/core-js/library/modules/$.def.js:38:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:166:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:192:12)
at waitForCondition (lib/asyncbox.js:107:11)
at XCUITestDriver.callee$0$0$ (…/…/…/…/lib/basedriver/commands/timeout.js:95:16)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[HTTP] <-- POST /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec/element 500 531 ms - 203
[HTTP] --> DELETE /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: [“240b9ec8-350c-4a56-b924-b58e7c538fec”]
[debug] [JSONWP Proxy] Proxying [DELETE /session/240b9ec8-350c-4a56-b924-b58e7c538fec] to [DELETE http://localhost:8100/session/8014115B-80A5-4C80-A74F-4BD4B934973D] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{\n “value” : {\n\n },\n “sessionId” : “9F62DCE9-D29E-444C-A78D-5D29EB5F0CF6”,\n “status” : 0\n}”
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 46700)
[XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGTERM’
[XCUITest] Shutting down Logger process (pid 46705)
[XCUITest] System log exited with code ‘0’
[XCUITest] Shutting down iproxy process (pid 46716)
[XCUITest] iproxy exited with code ‘null’
[debug] [XCUITest] In a web session. Removing remote debugger
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[Appium] Removing session 240b9ec8-350c-4a56-b924-b58e7c538fec from our master session list
[debug] [MJSONWP] Received response: null
[debug] [MJSONWP] But deleting session, so not returning
[debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/240b9ec8-350c-4a56-b924-b58e7c538fec 200 518 ms - 76

This is expected. Appium cannot handle a context switch to another app.

Appium actually handles it pretty well…or at least it used to. It works fine on Android and on iphone 6. However, on iPhone 5s and iPhone 7 I`m seeing these issues.