Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Attaches to Chrome instead of iOS Device on Windows #10

Open
hoovercj opened this issue Aug 23, 2016 · 12 comments
Open

Attaches to Chrome instead of iOS Device on Windows #10

hoovercj opened this issue Aug 23, 2016 · 12 comments

Comments

@hoovercj
Copy link
Member

hoovercj commented Aug 23, 2016

I've followed the instructions as I see them:

  1. Install iTunes
  2. Install extension
  3. Restart vscode
  4. Add a launch.json (see below)
  5. Try to attach to a tab/etc. from debugger pane

Result:
At this point it is just connecting to my machine's Chrome when what I really want is to connect to the tab that is open on my iOS device and connected via USB. If the tab is open in chrome it will attach to it, otherwise it gives me a "chrome-debugger-error: tab not found, available tabs are...".

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to an iOS device with URL",
            "type": "ios",
            "request": "attach",
            "port": 9222,
            "url": "http://www.example.com",
            "webRoot": "${workspaceRoot}",
            "deviceName": "*"
        }
    ]
}
@auchenberg
Copy link
Contributor

Hi @hoovercj ,

Can I get you to enable logging by setting the diagnosticLogging to true in your launch.json config?

You should see something like this in the console:

›OS: darwin x64
  ›Node: v5.10.0
  ›vscode-chrome-debug-core: 0.1.16
  ›debugger-for-ios-web: 0.1.2
  ›spawn('/usr/local/bin/ios_webkit_debug_proxy', ["--no-frontend","--config=null:9222,:9223-9323"])
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json
  ›Discovering targets via http://127.0.0.1:9223/json

@nbapat43
Copy link

nbapat43 commented Aug 25, 2016

Hi I am trying to do both connect via Window PC and an Ipad. I still cannot get it to load on the PC.

Here is my attach config: { "name": "Attach to an iOS device", "type": "ios", "request": "attach", "port": 9222, "url": "https://www.tatoos.com/?store=1", "webRoot": "developer/tatoos.com/sign/", "deviceName": "Nicolas's iPad", "diagnosticLogging": true }

When I run the debugger I get this error "[debugger-for-chrome] Got a response from the target app, but no target pages found" and this console:
`

  • ›OS: win32 ia32
  • ›Node: v5.10.0
  • ›vscode-chrome-debug-core: 0.1.16
  • ›debugger-for-ios-web: 0.1.2
  • ›spawn('C:\Users\User.vscode\extensions\msjsdiag.debugger-for-ios-web-0.1.2\node_modules\vs-libimobile\lib\ios_webkit_debug_proxy.exe', ["--no-frontend","--config=null:9222,:9223-9323"])
  • ›Warning: Can't find a device with deviceName: Nicolas's iPad. Available devices: []
  • ›Discovering targets via http://127.0.0.1:9222/json
  • ›Discovering targets via http://127.0.0.1:9222/json
  • ...
  • ›Discovering targets via http://127.0.0.1:9222/json
  • ›Discovering targets via http://127.0.0.1:9222/json
  • ›Error: Got a response from the target app, but no target pages found
  • at Object.errP (C:\Users\User.vscode\extensions\msjsdiag.debugger-for-ios-web-0.1.2\node_modules\vscode-chrome-debug-core\out\src\utils.js:225:13)
    
  •  at C:\Users\User.vscode\extensions\msjsdiag.debugger-for-ios-web-0.1.2\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeTargetDiscoveryStrategy.js:13:26
    
  •  at process._tickCallback (internal/process/next_tick.js:103:7)
    
    `

@auchenberg
Copy link
Contributor

@nbapat43 Looks like the debugger is able to connect to your iOS device, but it can't find a tab with the URL https://www.tatoos.com/?store=1 open. Please make sure Safari is opened with the tab, and the device isn't locked.

@auchenberg
Copy link
Contributor

@nbapat43 @hoovercj I just wanna follow up here. Still having problems?

@hoovercj
Copy link
Member Author

hoovercj commented Sep 1, 2016

Apologies, I didn't get a chance to look into this again until now.

It turns out the solution is "close chrome". If chrome is open, it will only try to attach there. If I close chrome, it will attach to the iPhone.

@Nikoltod
Copy link

Hi guys I was wondering is there a way to see the generated sources on the page much like the "Sources" tab in Chrome - I want to debug a webpage that isn't hosted by me. Is it possible ?

I'm sorry that I didn't open a seperate thread - I'm going to open one if it's needed. Thanks !

@cfjedimaster
Copy link

Hey folks - I'm having this same problem. I closed Chrome completely on my PC. My iPhone is open to the right URL. I enabled logging, but nothing there seems to add additional info. What else can I try?

@camelinckx
Copy link

@auchenberg I am having the same symptoms as @nbapat43 above...
I am curious, his trace (like mine) says:
›Warning: Can't find a device with deviceName: XYZ. Available devices: []
but in your reply, you seem to think it found the device?
I've tried renaming the device, making it lowercase, etc, to no avail.
Any help would be much appreciated.

@thomas-darling
Copy link

I'm getting the exact same error, except I don't see this:
›Warning: Can't find a device with deviceName: Nicolas's iPad. Available devices: []

Unfortunately, closing Chrome does not seem to help.
So far, it has refused to debug anything, no matter what I do.

@auchenberg
Copy link
Contributor

This debug extension hasn't been maintained in a while. My advice would be to look into https://medium.com/@auchenberg/hello-remotedebug-ios-webkit-adapter-debug-safari-and-ios-webviews-from-anywhere-2a8553df7465, which has a guide for VS Code too.

@cfjedimaster
Copy link

If the plan is to not maintain this anymore (which is totally understandable), should the readme be updated to say as much?

@auchenberg
Copy link
Contributor

@cfjedimaster Added in dae1e00

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants