How to Use vConsole for Mobile Web Debugging in Frontend Development

This guide explains how vConsole, a lightweight tool from WeChat's frontend team, enables developers to view console.log output directly on mobile browsers, providing step‑by‑step usage instructions, example code, and screenshots of the on‑screen console.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
How to Use vConsole for Mobile Web Debugging in Frontend Development

During frontend development, developers often use console.log or console.info to output log information, which can be easily viewed in a desktop browser's console. However, when debugging on mobile devices, accessing these logs becomes difficult.

vConsole is a small, easy‑to‑use tool created by WeChat's frontend team that solves this problem by allowing developers to view console logs directly on mobile devices.

Demo

The floating button at the bottom‑right opens the console, where logged messages are displayed.

Usage

1. Download vConsole from its project page: https://github.com/WechatFE/vConsole.

2. Include vconsole.min.js in your page.

3. Use standard console methods ( log, info, debug, warn, error) in your JavaScript as usual.

Example Code

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="vconsole.min.js"></script>
<script>
window.onload = function (){
  console.log('hello world');
}
function testInfo(){
  alert('info');
  console.info('test info');
}
</script>
</head>
<body>
<h1>vConsole test</h1>
<button onclick="testInfo()">INFO</button>
</body>

The effect screenshot shows the console displaying the logged messages.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaScriptvConsole
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.