ios-webkit-debug-proxy: ios-webkit-debug-proxy get random disconnects from Safari on physical device with error

Hi, I’m running some tests in parallel on several iOS device at once. I’m running the tests through Selenium Grid. My config is this:

Appium - 1.5.2 iOS devices - from 8.4.1 to 9.3.2 versions ios webkit debug proxy - 1.6 OS X El Capitan - 10.11.4 Xcode - 7.3.1 (7D1014)

I already double checked if my dependencies are all up date. I checked this dependencies: libusb - 1.0.20 libplist - 1.12 usbmuxd - 1.0.10 libimobiledevice - 1.2.0 ideviceinstaller - 1.1.0

My Web Inspector is enabled. I’ve already read all the issues related to this topic, already tried all the solution i’ve read there and no one solved my problems with the random proxys disconnect from the devices. Already tested another i-w-d-p (this one https://github.com/jchuong/ios-webkit-debug-proxy) and still facing the same issues.

Safari launcher always gets open on all devices, and then he open the Apple page, but when needs go to the page that I gave on the tests sometimes goes, sometimes not, and when will not is due to proxy already disconnected from the device.

The problem is this like some other related before:

> Connected :27755 to iPhone 5S  (device udid)

> Unknown app_id PID:2149
> Invalid message _rpc_applicationSentListing: <dict>
>   <key>WIRApplicationIdentifierKey</key>
>   <string>PID:2149</string>
>   <key>WIRListingKey</key>
>   <dict>
>   </dict>
> </dict>
> Disconnected :27755 from iPhone 5S  (device udid)
> 

And sometimes like this:

> Connected :27754 to iPhone 5C (device did)

> Unknown app_id PID:1645
> Invalid message _rpc_applicationSentListing: <dict>
>   <key>WIRApplicationIdentifierKey</key>
>   <string>PID:1645</string>
>   <key>WIRListingKey</key>
>   <dict>
>       <key>1</key>
>       <dict>
>           <key>WIRPageIdentifierKey</key>
>           <integer>1</integer>
>           <key>WIRURLKey</key>
>           <string>http://www.apple.com/</string>
>           <key>WIRTitleKey</key>
>           <string>Apple</string>
>           <key>WIRTypeKey</key>
>           <string>WIRTypeWeb</string>
>       </dict>
>   </dict>
> </dict>
> Disconnected :27754 from iPhone 5C (device did)
> 

Is this issue already fixed or its a issue for iOS 9.x versions?

Regards

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

@artygus Seem I found a root cause

In Normal behavior, after sending “_rpc_forwardGetListing”, the ios-webkit-debug-proxy expects that it will receive 2 messages

[_rpc_applicationSentListing:] <dict>
    <key>WIRApplicationIdentifierKey</key>
    <string>PID:258</string>
    <key>WIRListingKey</key>
    <dict>
    </dict>
</dict>

[_rpc_applicationConnected:] <dict>
    <key>WIRApplicationIdentifierKey</key>
    <string>PID:9827</string>
    <key>WIRIsApplicationProxyKey</key>
    <true/>
    <key>WIRApplicationNameKey</key>
    <string></string>
    <key>WIRApplicationBundleIdentifierKey</key>
    <string>com.apple.WebKit.WebContent</string>
    <key>WIRIsApplicationActiveKey</key>
    <integer>1</integer>
    <key>WIRHostApplicationIdentifierKey</key>
    <string>PID:258</string>
</dict>

However Abnormal behavior, the ios-webkit-debug-proxy got 2 same messages and then got a message with unknown app_id

[_rpc_applicationSentListing:] <dict>
    <key>WIRApplicationIdentifierKey</key>
    <string>PID:194</string>
    <key>WIRListingKey</key>
    <dict>
    </dict>

</dict>

[_rpc_applicationSentListing:] <dict>
    <key>WIRApplicationIdentifierKey</key>
    <string>PID:194</string>
    <key>WIRListingKey</key>
    <dict>
    </dict>
</dict>

[_rpc_applicationSentListing:] <dict>
    <key>WIRApplicationIdentifierKey</key>
    <string>PID:197</string>
    <key>WIRListingKey</key>
    <dict>
        <key>1</key>
        <dict>
            <key>WIRPageIdentifierKey</key>
            <integer>1</integer>
            <key>WIRURLKey</key>
            <string>http://demoqa.com/contact/</string>
            <key>WIRTitleKey</key>
            <string>Contact | Demoqa</string>
            <key>WIRTypeKey</key>
            <string>WIRTypeWeb</string>
        </dict>
    </dict>
</dict>

Currently, I workaround it by resend “_rpc_forwardGetListing” if Unknown App_id and it works like a charm

Logs

OK: https://gist.github.com/nghiadhd/4f6bd63c5440828083d839d053fb1d68#file-webkit_proxy_ok NG: https://gist.github.com/nghiadhd/6b6fee1c87ff4482e8e0a0a2d4f86ebf#file-webkit_proxy_ng

@artygus We at Appium [https://github.com/appium/appium/blob/master/bin/ios-webkit-debug-proxy-launcher.js] suggests our users to use ios-webkit-debug-proxy for safari automation on iOS real devices. I see many of the issues are related to random disconnect of ios-webkit-debug-proxy.I see ios-webkit-debug-proxy has a tremendous use case behind web automation support.Would be great if you prioritize this issue and get it sorted.

@artygus @SrinivasanTarget On iPhone 6S with iOS 10.0, I am initially able to connect to the iPhone via ios debug webkit. But on trying to search for a Webview the connection breaks.

Same scenario works well on iOS 9.3.5.

Dependency versions: OS X El Capitan - 10.11.6 ios-webkit-debug-proxy 1.7 libimobiledevice HEAD-00424f4 libplist 1.12 libusb 1.0.20 usbmuxd 1.0.10 1.0.10_1 ideviceinstaller 1.1.0_2

Logs: $ ios_webkit_debug_proxy -c <UDID>:27753 Connected :27753 to Mayuresh’s iPhone (UDID) Unknown app_id PID:456 Invalid message _rpc_applicationSentListing: <dict> <key>WIRApplicationIdentifierKey</key> <string>PID:456</string> <key>WIRListingKey</key> <dict> <key>3</key> <dict> <key>WIRPageIdentifierKey</key> <integer>3</integer> <key>WIRTitleKey</key> <string>JSContext</string> <key>WIRTypeKey</key> <string>WIRTypeJavaScript</string> </dict> </dict> </dict> Disconnected :27753 from Mayuresh’s iPhone (UDID) Logs seems similar to once posted by @joaopedroms22

@SrinivasanTarget you can get in brew with --HEAD flag