Git Product home page Git Product logo

remotedebug-ios-webkit-adapter's Introduction

RemoteDebug iOS WebKit Adapter

Build Status Release

RemoteDebug iOS WebKit Adapter is an protocol adapter that Safari and WebViews on iOS to be debugged from tools like VS Code, Chrome DevTools, Mozilla Debugger.html and other tools compatible with the Chrome Debugging Protocol.

Read more in the introduction blog post on Medium: Hello RemoteDebug iOS WebKit Adapter: iOS web debugging with Chrome DevTools, VS Code & Mozilla Debugger.html ๐Ÿ“ก๐Ÿ“ฑ

Important message for Windows users!
Currently the adapter doesn't work for IOS 12+. For IOS 11 there are a few additional steps, as described here.

Getting Started

1) Install dependencies

Before you use this adapter you need to make sure you have the latest version of iTunes installed, as we need a few libraries provided by iTunes to talk to the iOS devices.

Linux

Follow the instructions to install ios-webkit-debug-proxy and libimobiledevice

Windows

See the above warning for Windows users

Install ios-webkit-debug-proxy and libimobiledevice. On Windows you can use scoop:

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

OSX/Mac

Make sure you have Homebrew installed, and run the following command to install ios-webkit-debug-proxy and libimobiledevice

brew update
brew unlink libimobiledevice ios-webkit-debug-proxy usbmuxd
brew uninstall --force libimobiledevice ios-webkit-debug-proxy usbmuxd
brew install --HEAD usbmuxd
brew install --HEAD libimobiledevice
brew install --HEAD ios-webkit-debug-proxy

2) Install latest version of the adapter

npm install remotedebug-ios-webkit-adapter -g

3) Enable remote debugging in Safari

In order for your iOS targets to show up, you need to enable remote debugging.

Open iOS Settings => Safari preferences => enable "Web Inspector"

4) Make your computer trust your iOS device.

On MacOS you can use Safari to inspect an iOS Safari tab. This will ensure the device is trusted.

On Windows starting iTunes could prompt the "Trust this computer" dialog.

5) Run the adapter from your favorite command line

remotedebug_ios_webkit_adapter --port=9000

BTW: ios-webkit-debug-proxy will be run automatically for you, no need to start it separately.

6) Open your favorite tool

Open your favorite tool such as Chrome DevTools or Visual Studio Code and configure the tool to connect to the protocol adapter.

Configuration

Usage: remotedebug_ios_webkit_adapter --port [num]

Options:
  -p, --port  the adapter listerning post  [default: 9000]
  --version   prints current version

Usage

Usage with Chrome (Canary) and Chrome DevTools

You can have your iOS targets show up in Chrome's chrome://inspect page by leveraging the new network discoverbility feature where you simple add the IP of computer running the adapter ala localhost:9000.

Using with Mozilla debugger.html

You can have your iOS targets show up in Mozila debugger.html, by starting remotedebug_ios_webkit_adapter --port=9222 and selecting the Chrome tab.

Using with Microsoft VS Code

Install VS Code, and the VS Code Chrome Debugger, then create a launch.json configuration where port is set to 9000, like below:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "iOS Web",
            "type": "chrome",
            "request": "attach",
            "port": 9000,
            "url": "http://localhost:8080/*",
            "webRoot": "${workspaceRoot}/src"
        }
    ]
}

Architecture

The protocol adapter is implemented in TypeScript as Node-based CLI tool which starts an instance of ios-webkit-debug-proxy, detects the connected iOS devices, and then starts up an instance of the correct protocol adapter depending on the iOS version.

How to contribute

npm install
npm start

Diagnostics logging

DEBUG=remotedebug npm start

License

MIT

remotedebug-ios-webkit-adapter's People

Contributors

aamulumi avatar arilotter avatar auchenberg avatar benzhe avatar carpben avatar cmaraglio avatar elitree avatar ewanharris avatar gogoprog avatar joemeeks avatar kriserickson avatar oleg-codaio avatar oliverjash avatar pandreyn avatar paulirish avatar qkdreyer avatar sardtok avatar skrat avatar taneltm avatar wiedikerli avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.