Safari on iOS, ios_webkit_debug crashing when SafariLauncher launches Safari

I am trying to run web app testing on a real iPad. I have SafariLauncher installed on the iPad. I have the ios-webkit-debug-proxy running. When the test is initiated, SafariLauncher loads and launches Safari and then navigates to the default page. As soon as Safari launches, ios_webkit_proxy disconnects from the iPad with an invalid message. The Selenium test then fails since it can not connect to the proxy.

How can I get ios_webkit_proxy to not crash? I have installed via brew and built from source with the same result.

ios-webkit-debug-proxy log shows :

"Invalid message _rpc_applicationUpdated: <dict>
	<key>WIRApplicationBundleIdentifierKey</key>
	<string>com.apple.WebKit.WebContent</string>
	<key>WIRHostApplicationIdentifierKey</key>
	<string>PID:338</string>
	<key>WIRApplicationNameKey</key>
	<string></string>
	<key>WIRIsApplicationProxyKey</key>
	<true/>
	<key>WIRIsApplicationActiveKey</key>
	<integer>0</integer>
	<key>WIRApplicationIdentifierKey</key>
	<string>PID:341</string>
</dict>
ss.remove_fd(10)
Disconnected :27753 from Adam Teja’s iPad (b574a5862150382a6d27ec58dc0ee860472de311)
ss.remove_server_fd(4)

the appium log shows,

"el":"SafariLauncher","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0","x":20,"y":-256,"width":748,"height":1024},">":[{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,
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
"

versions:

  • Mac OS X 10.9.5
  • XCode 6.1
  • iOS 8.1
  • Appium 1.4
  • ios_web_proxy_debug 1.4

I have the same issue, with exactly same configuration, but with appium 1.2.3
couldnt find any resolution yet, would be great if some light can be throwed on this

Hi…

Even i Have same issue with below configuration,
Mac IOS:10.10
Appium version: 1.3.1
xcode version: Xcode 6
iOS SDK: 8.0.

Please some help to resolve this issue.

Try:

1/ brew install --HEAD ideviceinstaller

2/ If the error is still there, try the tool in this PR:

Hi Sebv,

Thanks for the reply…

I tried to install ideviceinstaller with the above mentioned command but couldn`t succeed in installation.

Getting Error like this,

brew install --HEAD ideviceinstaller
==> Installing dependencies for ideviceinstaller: libtool, pkg-config, li
==> Installing ideviceinstaller dependency: libtool
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libtool-2.4
Already downloaded: /Library/Caches/Homebrew/libtool-2.4.3.yosemite.bottle.tar.gz
Error: SHA1 mismatch
Expected: ede326069fb609eb68c66718f1d03b9c98c16e09
Actual: ddaaeba18bc12ec9431219bde8e4a6ec9af38b96
Archive: /Library/Caches/Homebrew/libtool-2.4.3.yosemite.bottle.tar.gz
To retry an incomplete download, remove the file above.
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/libtool/libtool-2.4.3.tar.xz
Already downloaded: /Library/Caches/Homebrew/libtool-2.4.3.tar.xz
Error: SHA1 mismatch
Expected: 7e946bd07b846a8803bf4321e82cd6be8059c0ca
Actual: f6c14576e8872f1d940de7bee01658e675ba65ec
Archive: /Library/Caches/Homebrew/libtool-2.4.3.tar.xz
To retry an incomplete download, remove the file above.

I tried to remove mentioned files in error log and again tried to install but no luck.

Please suggest.

Thanks,
Rashmi

try:
brew doctor
brew update

Still facing the same issue

Seb , your tool helped. Thanks a lot!

Hi Seb,

i installed ideviceinstaller “brew install --HEAD ideviceinstaller” but still facing

Invalid message _rpc_applicationUpdated: this issue in ios-webkit-proxy console

is there something need to be started after installing ideviceinstaller?

Regards,
Rashmi.

@sebv, thanks a million, installing Appium v1.3.3-pre build with the ios-webkit-debug-proxy launcher worked for me!

Hi Adam,

Could you please tell me the steps to install Appium v1.3.3-pre build with the ios-webkit-debug-proxy launcher.

Thanks,
Rashmi

just download the file.it is standalone.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Hi Thanks Sebv… now ios-webkit-proxy works fine with no errors.

But still i coudn`t succed with ios device safari test case execution.

Issue is
SafariLauncher loads and launches Safari in ios device and then navigates to the
default page. After this it is not navigating to specified url.

DesiredCapabilities capabilitiesIOS = new DesiredCapabilities();

capabilitiesIOS.setCapability(CapabilityType.BROWSER_NAME,“iOS”);
capabilitiesIOS.setCapability(“platformName”, “iOS”);
capabilitiesIOS.setCapability(“version”,“8.1”); capabilitiesIOS.setCapability(“app”,"/users/Library/Developer/Xcode/DerivedData/SafariLauncher-cgbztfhtwfbpbhdfdrqugggksjjp/Build/Products/Debug-iphonesimulator/SafariLauncher.app");
capabilitiesIOS.setCapability(“deviceName”, “iPad”);
capabilitiesIOS.setCapability(“autowebview”,true);
capabilitiesIOS.setCapability(“udid”, “b331d45d209fd3b2e118fbfd68965c5f7e472b49”);
Thread.sleep(30000);
driver = new RemoteWebDriver(new URL(“http://0.0.0.0:4723/wd/hub”),capabilitiesIOS);

log.info(“after…”);

Thread.sleep(5000);

driver.get(“https://www.google.co.in/”);

Please help me to resolve this issue.

Thanks,
Rashmi

hi @sebv
I have tried brew install --HEAD ideviceinstaller but it is showing error while installing as

dvtcddmac:~ sas$ brew install --HEAD ideviceinstaller

==> Cloning http://git.sukimashita.com/ideviceinstaller.git

Updating /Library/Caches/Homebrew/ideviceinstaller–git

==> Checking out branch master

==> Patching

==> ./autogen.sh

configure.ac:14: error: possibly undefined macro: AM_PROG_CC_C_O

configure.ac:15: error: possibly undefined macro: AC_PROG_LIBTOOL

configure.ac:74: error: possibly undefined macro: AS_COMPILER_FLAGS

./configure: line 2196: syntax error near unexpected token `dist-bzip2’

./configure: line 2196: `AM_INIT_AUTOMAKE(dist-bzip2 no-dist-gzip check-news)’

READ THIS: http://git.io/brew-troubleshooting

Hi,
I have successfully reinstalled ios_webkit_debug_proxy with the latest version from github. Now it is not crashing for iOS 8.1 but I am still getting below error :

Could not connect to WebKitRemoteDebugger server
Failed to start an Appium session, err was: Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED
Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED

Plz help to solve this problem as I am stucked on iOS 8.1.

I am using below mentioned versions of Appium and ios_webkit_debug_proxy :

Appium :

commit 6c8eadead43a8d20b73b32b5bc9ed6f6de78f4c7
Merge: dafce3a a124a15
Author: Jonathan Lipps [email protected]
Date: Tue Feb 10 15:13:01 2015 -0800
Merge pull request #4526 from appium/v1.3.5-branch
v1.3.5 branch

ios_webkit_debug_proxy :

commit ed71f7351dac3f697ba5e3bab96d70249cf1e63f
Author: James Chuong [email protected]
Date: Wed Feb 11 10:27:21 2015 -0800
Fixed spelling

Thanks in Advance.

@gajeshwar

This is a known issue with 8.1, please use ios-webkit-debug-proxy-launcher.js to handle this. run the command ./bin/ios-webkit-debug-proxy-launcher.js -cUDID -d before running the test on real device.

This should resolve the issue.

Thanks,
Amarnath Rayudu

1 Like

@AmarnathRayudu

Thanks for your solution.
Actually I had given wrong port number for ios_webkit_debug_proxy. After providing correct port number it’s working now. Anyways I have tried your solution as well and it’s also working. :smile:

I am facing the same issue, from where can i get ios-webkit-debug-proxy-launcher.js I did the brew install ios-webkit-debug-proxy. but i don’t get the launcher with it. Please let me know how to get and run it.

Regards,
Venkatesh

The launcher is part of the Appium source. You can find it there: https://github.com/appium/appium/blob/master/bin/ios-webkit-debug-proxy-launcher.js