diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..91c3d5c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM node:14-slim + +LABEL maintainer="Rob Watson " + +RUN apt-get update && apt-get install -y autoconf build-essential git libtool \ + libconfig-dev libssl-dev python3-dev + +WORKDIR /src +RUN git clone https://github.com/libimobiledevice/libplist.git +WORKDIR /src/libplist +RUN ./autogen.sh +RUN make +RUN make install + +WORKDIR /src +RUN git clone https://github.com/libimobiledevice/libusbmuxd.git +WORKDIR /src/libusbmuxd +RUN ./autogen.sh +RUN make +RUN make install + +WORKDIR /src +RUN git clone https://github.com/libimobiledevice/libimobiledevice.git +WORKDIR /src/libimobiledevice +RUN ./autogen.sh +RUN make +RUN make install + +WORKDIR /src +RUN git clone https://github.com/google/ios-webkit-debug-proxy.git +WORKDIR /src/ios-webkit-debug-proxy +RUN ./autogen.sh +RUN make +RUN make install + +RUN npm install -g remotedebug-ios-webkit-adapter + +ENV LD_LIBRARY_PATH /usr/local/lib +ENTRYPOINT ["remotedebug_ios_webkit_adapter"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..4188f50 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# remotedebug-ios-webkit-adapter-docker + +A Docker container containing everything needed to run Chrome devtools against an iOS device. + +Relies on the [remotedebug-ios-webkit-adapter project](https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter), which in turn relies on libimobiledevice, libusbmuxd, libplist and ios-webkit-debug-proxy. + +Tested with iOS 13.5.1 on an 2018 iPad Pro 11 inch and 2018 iPhone 8 Plus. + +## Usage + +1. Plug iOS device in to Linux box via USB +2. Ensure device is trusted +3. Launch the Docker container: + +``` +docker run --privileged \ + -p 9000:9000 \ + -v /dev/bus/usb:/dev/bus/usb \ + -v /var/run:/var/run \ + netfluxio/remotedebug-ios-webkit-adapter-docker +``` + +4. Open Chrome and visit `chrome://inspect` +5. Next to _Discover network targets_ click _Configure_ +6. Ensure `localhost:9000` is included in the list + +![Chrome Devtools](https://git.netflux.io/rob/remotedebug-ios-webkit-adapter-docker/raw/branch/dev/images/remotedebug-chrome.png) + +## Troubleshooting + +If you see this error: + +``` +remotedebug-ios-webkit-adapter failed to run with the following error: adapter.spawnProcess.close, code=255 +``` + +then the device is probably either not plugged in or not trusted (see also Debugging, below.) + +## Debugging + +Run docker with argument `-e DEBUG=remotedebug` diff --git a/images/remotedebug-chrome.png b/images/remotedebug-chrome.png new file mode 100644 index 0000000..ff23277 Binary files /dev/null and b/images/remotedebug-chrome.png differ