Could not connect to WebKitRemoteDebugger server

Hi,
I recently pulled the latest source from Appium source (running Appium latest release version 1.4.0) and I’m able to run my tests against iPhone real device iOS 8.2 without any problem. However when I tried to run the tests on second attempt, I got the following error on the Appium console. I have to kill the Appium service and reconnect the iOS webkit everyime in order for the tests to start running successfully again (successful only on first run)

Platform : iOS 8.2 real device
Appium version : 1.4.0
client binding : Ruby
OS : Mac 10.9.5
Xcode : 6.2


Appium console log


info: [debug] Waiting for 3000 ms before navigating to view.
info: [debug] Navigating to most recently opened webview
info: [debug] [REMOTE] Getting WebKitRemoteDebugger pageArray
error: [REMOTE] Could not connect to WebKitRemoteDebugger server
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED
info: [debug] Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED
at [object Object]. (/Users/tchong/appium/lib/devices/ios/ios.js:1666:12)
at [object Object]. (/Users/tchong/appium/lib/devices/ios/ios.js:1557:21)
at [object Object]. (/Users/tchong/appium/lib/devices/ios/ios.js:1544:21)
at [object Object]. (/Users/tchong/appium/lib/devices/ios/ios-hybrid.js:62:21)
at [object Object]. (/Users/tchong/appium/lib/devices/ios/webkit-remote-debugger.js:77:14)
at ClientRequest. (/Users/tchong/appium/node_modules/underscore/underscore.js:890:21)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:272:9)
at Socket.emit (events.js:107:17)
at net.js:451:14
at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not navigate to webview! Err: Error: connect ECONNREFUSED)”,“origValue”:“Could not navigate to webview! Err: Error: connect ECONNREFUSED”},“sessionId”:null}


iOS webkit debug log


Invalid message _rpc_applicationUpdated:
WIRApplicationIdentifierKey
PID:182
WIRIsApplicationProxyKey

WIRApplicationNameKey

WIRApplicationBundleIdentifierKey
com.apple.WebKit.WebContent
WIRIsApplicationActiveKey
0
WIRHostApplicationIdentifierKey
PID:180

ss.remove_fd(6)
Disconnected :27753 from Burberry iphone 6 (8b7b0d23bbbe13b42ad71dbb95c7664a248cc49c)
ss.remove_server_fd(4)

I’m experiencing the same problem with Appium 1.4.0 on iOS 8.3. Fortunately the fix is the same: stop Appium, unplug device, try again.

Hi ,
Pls help me as i am stuck in web browser testing in iOS real device but i am able to run automation steps in app on same iOS real device.
I have installed Safari launcher in my iOS phone using Xcode and my app is signed with dev account .
when i am running my code its open safari launcher click on open button but when safari browser open my iOS webkit getting crash
in logs i am getting bellow error
info: [debug] Navigating to most recently opened web view

info: [debug] [REMOTE] Getting WebKitRemoteDebugger pageArray

info: [debug] Cleaning up appium session

error: [REMOTE] Could not connect to WebKitRemoteDebugger server

and in iOS webkit i am getting error
Last login: Mon Sep 14 11:25:33 on ttys000

Administrators-Mac-mini:~ administrator$ ios_webkit_debug_proxy

Listing devices on :9221

Connected :9222 to iPhone 5S (90a0078ff099927f79ba49043a3240147a6f0efb)

Unknown app_id PID:184

Invalid message _rpc_applicationSentListing:

WIRApplicationIdentifierKey

PID:184

WIRListingKey

Disconnected :9222 from iPhone 5S (90a0078ff099927f79ba49043a3240147a6f0efb)

my code is

WebDriver wd;

	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("appium-version", "1.4.8");
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("platformVersion", "8.4");
    capabilities.setCapability("deviceName", "iPhone 5s");
	capabilities.setCapability("bundleId", "com.pyramidci.SafariLauncher");
	capabilities.setCapability("autoWebView", "true");
	capabilities.setCapability("udid", "90a0078ff099927f79ba49043a3240147a6f0efb");

	capabilities.setCapability("app", "/Users/administrator/Library/Developer/Xcode/DerivedData/iOSSampleApp-hgjbrohpjbndcfhiazafhzdvnlet/Build/Products/Debug-iphoneos/iOSSampleApp.app");
	wd = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
	wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

	wd.findElement(By.name("launch safari")).click();

Hi,

iOS-web-kit-debug-proxy connects and disconnects with rpc server immediately.
On running the Appium code on hybrid app, works well on native pages, but fails while switching to the web context.
Error Message on Appium log: Could not connect to WebKitRemoteDebugger server
Responding to client with error: {“status”:clock13:

Appium : 1.3.4
iOS device : 7.1
Xcode Version: 7.1
OSx Version: 10.10

@priyatech:
try installing ios-webkit-debug-proxy like:
brew install ios-webkit-debug-proxy
and if you don’t have brew then install brew first by
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
Hope this helps.