Removing iwdp
umutuzgur opened this issue · 10 comments
Hi there,
We started an Appium package called appium-ios-device where we are trying to remove iwdp as a decency as well and just use nodejs instead as iwdp doesn't have that much logic. I saw that there was an issue like this where this was mentioned #90. However, back then there was no solution for talking to the webinspector directly. I just wanted to mention that this is now possible.
Hi @umutuzgur
Can you elaborate on https://github.com/appium/appium-ios-device works? How is the Webkit Inspector Protocol exposed from the device?
Sure, I can explain how it works. What iwdp does is that it uses the libimobiledevice libraries which handles the part of connecting to the phone over the usbmuxd daemon running on someone's osx device. This daemon has a unix file socket place at /var/run/usbmuxd. If you follow the protocol which is described in some forums and also in libimobiledevice, you can access certain services on the phone and webinspectord is one one them.
This project handles the calls that needs to be done until you have a direct connection to webinspectord instance and at that point, you can send rpc commands that this daemon running on the phone. As far as I know, the connection should be Webkit Inspector Protocol after a tab is chosen. We will start integrating this to our remote debugger next week. I should have more information by then
I hope this was not so complicated. I believe the only commands that need to be implemented are these ones here for the setup part of connecting to a tab and the rest should be the inspector protocol https://github.com/google/ios-webkit-debug-proxy/blob/master/src/rpc.c
Interesting @umutuzgur. So it's a replacement for iwdp implemented in Node.js? Value is a pure node.js implemented?
@auchenberg Exactly. It is easier to understand since it is not written in C and easier to maintain
@umutuzgur, I'd be interested in pursuing this. Do you have a link to the changes you required to remove iwdb in appium that I could take a look at to see how we can achieve this?
Hi @ewanharris . Appium has already removed iwdp from the dependencies. We have this repo which helps us instrumenting web tests on iOS https://github.com/appium/appium-remote-debugger . Let me know if you have any questions
@umutuzgur Are you still using your own debugger, and have removed away from iwdp?
Yeap, that is correct
@umutuzgur Thanks for all the details. I spend some time looking into https://github.com/appium/appium-remote-debugger.
As I understand things appium-remote-debugger and appium-ios-device are currently MacOS only right?
The libs could be leveraged for other platforms, but we would have to bundle up libimobiledevice for those platforms and establish a way to communicate with libimobiledevice over non unix sockets.
@auchenberg It works under the assumption that /var/run/usbmuxd unix socket already exists. We just need to allow people to pass tcp ports for Windows support.
I don't think we need libimobiledevice for Windows since itunes comes with an usbmux daemon. However, if that is not the case, then we need to incorporate libimobiledevice's usbmuxd to make it work on linux. We did that in my previous company and it worked pretty well