Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows not able to inspect iOS 11 #79

Open
taneltm opened this issue Oct 18, 2017 · 35 comments

Comments

@taneltm
Copy link
Contributor

commented Oct 18, 2017

The issue is of course that the bundled ios-webkit- debug-proxy-win32 doesn't support it.
I installed this https://github.com/google/ios-webkit-debug-proxy then modified iosAdapter.js to use that instead of the bundled version under vs-libimobile - that way I was able to get the debugging to work!

But remotedebug_ios_webkit_adapter keeps logging an error while getting the device version:

...
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
New websocket connection to /ios_116146f0a7fea095bc5254fa3a1b35ec07699c7f/PID:433
Connection established to ws://127.0.0.1:9101/devtools/page/1
iosAdapter.getTargets
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
...

I'm guessing it's unable to get the version of the device from node_modules/vs-libimobile/lib/ideviceinfo.exe, when I run that directly, it says:

socket_receive_timeout: fd=456 recv returned 0
ERROR: Could not connect to lockdownd, error code -3
@bdice

This comment has been minimized.

Copy link

commented Dec 13, 2017

I finally got it to work with a lot of failed attempts. Here were my steps for any future users attempting to do the same. I am running Windows 10 with iOS 11 on my device.

  1. Following from this StackOverflow post, I installed Node, iTunes, and enabled web inspector on my iPad (Settings > Safari > Advanced). Using Powershell as administrator, install the remote debugger: npm install remotedebug-ios-webkit-adapter -g I attempted to run the adapter: remotedebug_ios_webkit_adapter --port=9000. I saw iosAdapter.getTargets over and over, but the page at chrome://inspect/#devices didn't show any remote targets at port 9000. (This is a recreation of the problem).

Now is the part where I try to make the edit for iOS 11.

  1. Download the latest release of https://github.com/google/ios-webkit-debug-proxy/. No need to install scoop. Just get the zip release. I grabbed version 1.8: https://github.com/google/ios-webkit-debug-proxy/releases/download/v1.8/ios-webkit-debug-proxy-1.8-win64-bin.zip

  2. Unzip that release. I chose to put it in the same folder as the broken library (to make the edit easier), in %AppData%\npm\node_modules\remotedebug-ios-webkit-adapter\node_modules\vs-libimobile\ios-webkit-debug-proxy-1.8-win64-bin

  3. Edit the file %AppData%\npm\node_modules\remotedebug-ios-webkit-adapter\out\adapters\iosAdapter.js. On line 132, it reads:
    const proxy = path.resolve(__dirname, '../../node_modules/vs-libimobile/lib/ios_webkit_debug_proxy.exe');
    Change this location to point to the location of the ios_webkit_debug_proxy.exe you unzipped earlier. I changed this line to say:
    const proxy = path.resolve(__dirname, '../../node_modules/vs-libimobile/ios-webkit-debug-proxy-1.8-win64-bin/ios_webkit_debug_proxy.exe');

Now try to run again:

  1. Re-open Chrome to chrome://inspect/#devices and run PowerShell as an administrator. Run remotedebug_ios_webkit_adapter --port=9000 and make sure Chrome is configured to search for a network target on that port (Discover Network Targets > Configure). Open Safari on your iPad. Hopefully this works.

I also had to unplug and re-plug my iPad before this would work. It appeared Windows hadn't yet configured the drivers properly. I can confirm that I also see the repeated error message mentioned by @taneltm above. Seeing this message may be a good confirmation that things should be working.

...
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
...
@mohamedmansour

This comment has been minimized.

Copy link

commented Jan 25, 2018

@bdice this worked great! We should merge that 1.8v in!

@auchenberg

This comment has been minimized.

Copy link
Member

commented Jan 25, 2018

@bdice @mohamedmansour Any of you interested in becoming maintainer? I simply don't have the time. My thinking is that a similar approach on Windows to how do we install ios-webkit-debug-proxy via a dependency manager needs to happen Windows, as the currently VS NPM package is way out of date.

@HaykoKoryun

This comment has been minimized.

Copy link

commented Feb 2, 2018

@bdice you are a lifesaver!

@fadupla

This comment has been minimized.

Copy link

commented Mar 29, 2018

Many thanks @bdice !

@auchenberg

This comment has been minimized.

Copy link
Member

commented Mar 29, 2018

@taneltm @bdice @HaykoKoryun @fadupla PRs for updating this are more than welcome. I don't have the bandwidth these days!

@JoeMeeks

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2018

@auchenberg @bdice @taneltm I have a PR ready:
#91

@Prinzhorn

This comment has been minimized.

Copy link

commented Apr 24, 2018

I'm slightly confused as I have the exact same symptoms on Ubuntu. However, for Mac/Linux the code uses the installed binary and not the one shipped with vs-libimobile.

else if (os.platform() === 'darwin' || os.platform() === 'linux') {
    which('ios_webkit_debug_proxy', function (err, resolvedPath) {
        if (err) {
            reject('ios_webkit_debug_proxy not found. Please install ios_webkit_debug_proxy (https://github.com/google/ios-webkit-debug-proxy)');
        }
        else {
            resolve(resolvedPath);
        }
    });
}

If In understand @bdice correctly the issue was resolved by using a more recent version of the ios_webkit_debug_proxy binary. But I have the most recent one installed and it successfully connects to my iPad when used directly.

$ ios_webkit_debug_proxy 
Listing devices on :9221
Connected :9222 to iPad (....)

However, running the adapter I get the exact symptoms described here

$ DEBUG=remotedebug remotedebug_ios_webkit_adapter
  remotedebug server.run, port=9000 +0ms
  remotedebug server.setupHttpHandlers +3ms
  remotedebug iOSAdapter.getProxySettings +2ms
  remotedebug iOSAdapter.getProxyPath +1ms
  remotedebug adapterCollection.start Map {} +13ms
  remotedebug adapter.start { port: 9100,
  proxyExePath: '/usr/local/bin/ios_webkit_debug_proxy',
  proxyExeArgs: [ '--no-frontend', '--config=null:9100,:9101-9201' ],
  pollingInterval: 3000,
  baseUrl: 'http://127.0.0.1',
  path: '/json' } +1ms
  remotedebug adapter.spawnProcess, path=/usr/local/bin/ios_webkit_debug_proxy +1ms
  remotedebug server.startTargetFetcher +206ms
remotedebug-ios-webkit-adapter is listening on port 9000
  remotedebug server.http.endpoint/json/version +192ms
  remotedebug server.http.endpoint/json +17ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +19ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.start { port: 9101,
  pollingInterval: 3000,
  baseUrl: 'http://127.0.0.1',
  path: '/json' } +2ms
  remotedebug adapter.start: Skip spawnProcess, no proxyExePath available +0ms
  remotedebug adapter.getTargets, metadata=[object Object] +0ms
  remotedebug server.http.endpoint/json/version +1s
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +4ms
  remotedebug iOSAdapter.getDeviceInfoPath +1ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +2ms
  remotedebug server.http.endpoint/json/version +1s
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +4ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +2ms
  remotedebug server.http.endpoint/json/version +1s
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +3ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +3ms
  remotedebug server.http.endpoint/json/version +1s
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +2ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +1ms
  remotedebug iOSAdapter.getTargets +718ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +3ms
  remotedebug iOSAdapter.getDeviceInfoPath +1ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +2ms
  remotedebug server.startTargetFetcher.fetched.0 +2ms
  remotedebug server.http.endpoint/json/version +278ms
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +3ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +2ms
  remotedebug server.http.endpoint/json/version +1s
  remotedebug server.http.endpoint/json +1ms
  remotedebug iOSAdapter.getTargets +0ms
iosAdapter.getTargets
  remotedebug iOSAdapter.getDeviceVersion +3ms
  remotedebug iOSAdapter.getDeviceInfoPath +0ms
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
  remotedebug adapter.getTargets, metadata=[object Object] +1ms
  remotedebug server.stop +930ms
  remotedebug server.stopTargetFetcher +1ms
  remotedebug adapterCollection.stop +1ms
  remotedebug adapter.stop +0ms
  remotedebug adapter.stop +1ms
@shard2001

This comment has been minimized.

Copy link

commented May 4, 2018

If you're behind a company proxy then in adapter.js and iosAdapter.js change

request(this._url)

to

request({'url':this._url, 'proxy': ''}

@generalov

This comment has been minimized.

Copy link

commented Nov 16, 2018

Thanks, @bdice! Your receipt still works in 2018. :)

error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]

This error message caused by vs-libimobile package that provides an outdated version of libimobiledevice library.

I downloaded latest version from https://www.nuget.org/packages/libimobiledevice/ and extracted it to the root of a project. I also changed path to ideviceinfo.exe in node_modules\remotedebug-ios-webkit-adapter\out\adapters\iosAdapter.js :

// const proxy = path.resolve(__dirname, process.env.USERPROFILE + '/AppData/Roaming/npm/node_modules/vs-libimobile/lib/ideviceinfo.exe');
const proxy = path.resolve("imobiledevice-x64-1.2.1-r223\\ideviceinfo.exe");

It prevents the error message. It is also safe to remove vs-libimobile from dependencies.

@auchenberg

This comment has been minimized.

Copy link
Member

commented Nov 21, 2018

@generalov Great insight. We need to find a way to download ideviceinfo.exe from a package manager on Windows or something like this. Are you aware of way to install globally via Nuget? Alternatively we could add libimobiledevice to scoop?

@generalov

This comment has been minimized.

Copy link

commented Nov 23, 2018

Hi @auchenberg, I'm not happy with external dependencies like scoop, Nuget and hardcoded paths to executables. It would be nice to have dependencies installed locally using npm package manager.

If npm does not provide enough functionality then what's about selenium-standalone's approach? It provides install command for end users to install all necessary binaries into local node_modules folder.

@auchenberg

This comment has been minimized.

Copy link
Member

commented Nov 23, 2018

@generalov I'm not a big fan either, but I don't want to distribute binaries with this project. On Linux/MacOS we leverage existing package managers where the binaries for dependencies are published and it works great.

Windows is the troublesome platform, and we had ios-webkit-debug-proxy publish it's binaries via scoop. The challenge is that theres no official windows builds of libimobiledevice being published, and I don't want to be in the business of maintaining such things.

@HarelM

This comment has been minimized.

Copy link

commented Jan 27, 2019

I'm following the instructions on the readme and here but still unable to debug chrome on my iPad.
Has anyone managed to do it recently?

@HarelM

This comment has been minimized.

Copy link

commented Jan 27, 2019

Sorry, the problem was that I needed to add the relevant port to chrome dev tools...

@B-Stewart

This comment has been minimized.

Copy link

commented Feb 28, 2019

@generalov I know it's been a while but what release did you download to get the .exe? Between the nupkg and release .zips I can't find anything I can download that has ideviceinfo.exe bundled in it.

@devonzara

This comment has been minimized.

Copy link

commented Feb 28, 2019

@B-Stewart download the ios-webkit-debug-proxy-1.8.3-win64-bin.zip from https://github.com/google/ios-webkit-debug-proxy/releases to find the executable.

That said, I'm having difficulties getting it to work. I modified iosAdapter.js to point to the executable from the Google release but it's still showing the error below over and over and no connection is appearing in Chrome.

iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]

Edit
After closing Chrome and all of my console windows, opening them again, and restarting the adapter; it worked. The screencast of the device lagged and crashed the Chrome tab several times but once I disabled that, it was smooth sailing.

@acalvino4

This comment has been minimized.

Copy link

commented Apr 11, 2019

I finally got it to work with a lot of failed attempts. Here were my steps for any future users attempting to do the same. I am running Windows 10 with iOS 11 on my device.

  1. Following from this StackOverflow post, I installed Node, iTunes, and enabled web inspector on my iPad (Settings > Safari > Advanced). Using Powershell as administrator, install the remote debugger: npm install remotedebug-ios-webkit-adapter -g I attempted to run the adapter: remotedebug_ios_webkit_adapter --port=9000. I saw iosAdapter.getTargets over and over, but the page at chrome://inspect/#devices didn't show any remote targets at port 9000. (This is a recreation of the problem).

Now is the part where I try to make the edit for iOS 11.

  1. Download the latest release of https://github.com/google/ios-webkit-debug-proxy/. No need to install scoop. Just get the zip release. I grabbed version 1.8: https://github.com/google/ios-webkit-debug-proxy/releases/download/v1.8/ios-webkit-debug-proxy-1.8-win64-bin.zip
  2. Unzip that release. I chose to put it in the same folder as the broken library (to make the edit easier), in %AppData%\npm\node_modules\remotedebug-ios-webkit-adapter\node_modules\vs-libimobile\ios-webkit-debug-proxy-1.8-win64-bin
  3. Edit the file %AppData%\npm\node_modules\remotedebug-ios-webkit-adapter\out\adapters\iosAdapter.js. On line 132, it reads:
    const proxy = path.resolve(__dirname, '../../node_modules/vs-libimobile/lib/ios_webkit_debug_proxy.exe');
    Change this location to point to the location of the ios_webkit_debug_proxy.exe you unzipped earlier. I changed this line to say:
    const proxy = path.resolve(__dirname, '../../node_modules/vs-libimobile/ios-webkit-debug-proxy-1.8-win64-bin/ios_webkit_debug_proxy.exe');

Now try to run again:

  1. Re-open Chrome to chrome://inspect/#devices and run PowerShell as an administrator. Run remotedebug_ios_webkit_adapter --port=9000 and make sure Chrome is configured to search for a network target on that port (Discover Network Targets > Configure). Open Safari on your iPad. Hopefully this works.

I also had to unplug and re-plug my iPad before this would work. It appeared Windows hadn't yet configured the drivers properly. I can confirm that I also see the repeated error message mentioned by @taneltm above. Seeing this message may be a good confirmation that things should be working.

...
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]
...

The repository mentioned, https://github.com/google/ios-webkit-debug-proxy/ , has no file named ios_webkit_debug_proxy.exe, yet we are instructed to change line 132 of iosAdapter.js to point to it's location. Am I missing something, or has this repository changed, or are these bad instructions?

@bdice

This comment has been minimized.

Copy link

commented Apr 11, 2019

@acalvino4 Try downloading a release with a binary, it's not in the repository itself: https://github.com/google/ios-webkit-debug-proxy/releases

@acalvino4

This comment has been minimized.

Copy link

commented Apr 11, 2019

Alright, found the right release (1.8.3) and followed all instructions on this thread (including shutting down all terminals and browsers, and unplugging/replugging my device as some have suggested), but I'm still getting the same error, and chrome://inspect/#devices is not showing any remote target (yes, I've added localhost:9000 to Discover network targets > Configure).

The only thing I notice that is different on my system from the solution posted is that the install path differs slightly from what @bdice has:

  1. I have Roaming in the directory tree between AppData and npm -> AppData/Roaming/npm/...
  2. Under the second node-modules folder, there is no vs-libimobile folder, which leads me to believe I missed installing something.

To install I had done:

scoop bucket add extras
scoop install ios-webkit-debug-proxy
npm install -g vs-libimobile
npm install remotedebug-ios-webkit-adapter -g

all in Administrator Power Shell, with success messages, as directed here.

@AusQB

This comment has been minimized.

Copy link

commented Apr 23, 2019

I was able to get it running to the point where my remote target shows up in DevTools (without having to perform @bdice's workaround), but when I click inspect nothing shows up in the inspector window. Powershell just keeps repeating the same messages he mentioned at the bottom of his post. This is on an 8 Plus running iOS 12.2.

@MrBearTW

This comment has been minimized.

Copy link

commented Apr 26, 2019

I was able to get it running to the point where my remote target shows up in DevTools (without having to perform @bdice's workaround), but when I click inspect nothing shows up in the inspector window. Powershell just keeps repeating the same messages he mentioned at the bottom of his post. This is on an 8 Plus running iOS 12.2.

I have the same problem, when I click inspect nothing shows up in the inspector window.
It has a warning "Consider disabling Chrome Data Server while debugging" in inspector window, I disable it , but it's still nothing shows up.
I am using Win10 with ios-webkit-debug-proxy(v1.8.4) and iPhone X.

@dzbiku

This comment has been minimized.

Copy link

commented Jun 11, 2019

anyone? I'm using X and win 10, but like @MrBearTW, i can see device and tabs, but without content

@fsiliadin

This comment has been minimized.

Copy link

commented Jun 11, 2019

I Have the same problem as @dzbiku and @MrBearTW. Maybe it's because the protocols are not up to date with recent ios versions? I can see that in the protocols folders we only have ios, ios8 and ios9, with ios 9 file as default value. Can you please provide insights to adapt this to latest ios versions?

@crewone

This comment has been minimized.

Copy link

commented Jun 26, 2019

I have the same as @MrBearTW , @dzbiku and @fsiliadin . Changing the path doesn't fix it.

@JenkaJmenka

This comment has been minimized.

Copy link

commented Jul 29, 2019

unfortunately I have the same issue. Following the instructions above didn't solve my problem.

@mikejpoole

This comment has been minimized.

Copy link

commented Sep 1, 2019

I am getting the following error as documented by @generalov above.

iosAdapter.getTargets
error.iosAdapter.getTargets.getDeviceVersion.failed.fallback, device=[object Object]

I understand that I need to install the libimobiledevice ideviceinfo.exe file but I cannot find it in any repos. Please can someone point me to this.

@mafsays

This comment has been minimized.

Copy link

commented Sep 2, 2019

@mikejpoole I can't get this to work at the moment but worth pointing out that when I did have it up and running, getting this error was an indication that the device was connected successfully, if I didn't get that error it meant it wasn't working! So worth checking your browser for the device despite the error.

@mikejpoole

This comment has been minimized.

Copy link

commented Sep 6, 2019

Thanks @mafsays . I did not realise that it was not an error message. I am now getting a "Unhandled promise rejection" errors. Is that also what is not working for you at the moment. I believe that is being dealt with in issue 138 with some PR's waiting to be merged to hopefully fix that.

@okandas

This comment has been minimized.

Copy link

commented Sep 11, 2019

also try remotedebug_ios_webkit_adapter --port=9222 for ios .... Worked for me on ios 11.

@carpben

This comment has been minimized.

Copy link
Contributor

commented Oct 3, 2019

This issue has been opened two years ago, for IOS 11. Two years later, and two IOS versions later, the issue has still not been resolved.
However, the documentation still represents the library as a solution for debugging IOS Safari from Windows. I suggest updateing the documentation to make it as clear as possible that this solution doesn’t currently work.
Installing this tool on Windows isn’t trivial (it requires 4 installations), so presenting this info before hand can save valuable time to other programmers.
@taneltm @bdice

@dimitar-nikovski

This comment has been minimized.

Copy link

commented Oct 17, 2019

The instructions provided by @bdice worked a charm in iOS 11, but updating to 13.1.3 causes the same errors as encountered by the OP

@carpben

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2019

I really appreciate the contribution of the library and the contributors. However, it has been two weeks since I wrote #79 (comment), and two years since this issue was originally opened.

Currently

  • This solution doesn't work for modern IOS for 2 years.
  • The documentation presents the library as a working solution for debugging IOS on Windows.
  • As a result developers install 4 separate installations and to invest their time for a solution we already know doesn't work.

We must update documentation and notify users about this limitation. I'll submit a suggestion.
@auchenberg @JoeMeeks @taneltm @vaskevich @skrat @qkdreyer @paulirish @pandreyn @ninjaonsafari @kriserickson @gogoprog @elitree @cmaraglio @benzhe @arilotter @Sardtok @OliverJAsh @AamuLumi

@auchenberg

This comment has been minimized.

Copy link
Member

commented Oct 17, 2019

@carpben This project is currently unmaintained. If you are interested in becoming an maintainer and taking a lead on this effort let me know.

@carpben

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2019

Thanks @auchenberg, Unfortunately, proffesionally I'm not the right person for this mission. I don't have experience or expertise in the relevant fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.