Skip to content

Guide · Open source

How to use eruda: add a mobile browser console to your page

Updated · written with AI from the project's own documentation and checked against our catalogue data

Eruda is an open-source developer console that runs inside a web page. It lets you read console output, errors and page details directly on a phone or tablet, without connecting the device to a desktop debugger. This guide shows how to install it, load it on a page, open the panel and decide when it is the right tool.

Erudaliriliri/eruda · ★ 21.2k · MIT

Quick start

  1. 1Confirm prerequisites. Make sure Node.js and npm are installed for the npm route.
  2. 2Install eruda. Run npm install eruda --save-dev in your project.
  3. 3Add the script. Include node_modules/eruda/eruda.js in your page with a script tag.
  4. 4Initialise the console. Add a script tag that calls eruda.init().
  5. 5Open on a mobile device. Load the page in the mobile browser and open the eruda panel.
  6. 6Remove before release. Strip the script or gate it so end users never see the panel.

What eruda does and who it is for

Eruda is a console for mobile browsers. You add a script to your page and call eruda.init(), and a panel appears that you can open while testing on a mobile device.

It is aimed at checking how a website behaves in mobile browsers, where normal desktop developer tools are often not available. It suits web developers testing a site on a phone or tablet, front-end developers who need console logs without a desktop debugger, and teams checking mobile layouts or script errors during development.

  • Console output and errors from the page
  • Page details, viewable on the device itself
  • Useful when you do not want to connect a device to a desktop debugger

Install eruda with npm

The npm route is the one the project documents first. Node.js and npm are the prerequisites. Install eruda as a dev dependency so it stays out of your production dependencies.

  • Prerequisites: Node.js and npm
npm install eruda --save-dev

Add eruda to your page and call eruda.init()

After installing, add the script to your page, then call eruda.init() in a second script tag. The README shows the local path from node_modules.

If you prefer not to use npm, the project is also available on jsDelivr and cdnjs. The README gives a jsDelivr script tag using the same eruda.init() call.

  • Local file: node_modules/eruda/eruda.js
  • CDN option: https://cdn.jsdelivr.net/npm/eruda
  • Also listed on cdnjs
<script src="node_modules/eruda/eruda.js"></script> <script>eruda.init();</script>

Open the panel on your phone or tablet

Load the page in the mobile browser you are testing. Once eruda.init() runs, the debugging panel is available there. Use it to check console logs and errors while you exercise the page on the device.

The project also offers a demo you can open on a phone at eruda.liriliri.io, which is useful to see the panel before adding it to your own site.

  • Open your page on the device under test
  • Trigger the behaviour you want to inspect
  • Read console output and errors in the panel

Keep eruda out of production

Eruda is a developer tool added to pages. A debugging panel on a production site would be visible to end users unless you remove it or gate it behind a condition. Load it only in development builds or on test environments.

For full usage details, including the documented options, read the official documentation at eruda.liriliri.io/docs/.

  • Use it in development or staging
  • Remove the script or gate it before release
  • Check the docs for usage beyond the basic init call

The README lists related tools. chii is a remote debugging tool, and chobitsu implements the Chrome devtools protocol in JavaScript. eruda-android is a simple webview with eruda loaded automatically. Comparable projects named for this topic include chii, Chrome DevTools remote debugging and vConsole.

Pick eruda when you want a panel that lives in the page itself. Consider Chrome DevTools remote debugging if you are happy connecting the device to a desktop.

  • chii: remote debugging tool
  • chobitsu: Chrome devtools protocol implementation in JavaScript
  • eruda-android: webview with eruda loaded automatically

What people use it for

  • Checking console errors on a page while testing on a phone
  • Reviewing mobile layouts during front-end development
  • Reading console logs without connecting a device to a desktop debugger
  • Testing a page in a webview loaded through eruda-android

Frequently asked questions

Is eruda free to use?

Eruda is released under the MIT licence, as listed in the project. Check the repository licence file for the full terms before using it in your project.

What do I need to install eruda?

The npm install route requires Node.js and npm. The README also shows a CDN option through jsDelivr and cdnjs that uses a script tag instead.

How do I install eruda?

Run npm install eruda --save-dev, then add the script from node_modules/eruda/eruda.js and a script tag that calls eruda.init().

Should I leave eruda on a live website?

No. The panel would be visible to end users unless you remove it or gate it. Use it in development or staging environments.

What are alternatives to eruda?

The project names chii, Chrome DevTools remote debugging and vConsole as comparable projects. chii is a remote debugging tool, and vConsole is another in-page console.

How is eruda different from desktop browser devtools?

Desktop browser tools already cover desktop testing. Eruda targets mobile browsers, where normal desktop developer tools are often not available, and runs as a panel inside the page.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Eruda suits web developers and teams who need console logs and errors from a page running on a phone or tablet, without a desktop debugger connection. Skip it if you only test in desktop browsers, or if you cannot make sure it is removed from production builds.

Install options & downloads