A small extension that opens the project you're working on in VS Code on other devices on your network: your phone, a tablet, another computer, a colleague's laptop. It gives you a QR code and a URL, so you don't have to look up your computer's IP address or your dev server's port.
It does not simulate a device inside VS Code. Like Live Server's Go Live, it starts your project on your computer (or uses the dev server you already have running), works out the address other devices can reach it on, and shows that address as a URL and a QR code. Open it on the device and the page runs in that device's own browser: real touch, real screen size, real Safari or Chrome.
Mobile Serve has no telemetry and needs no account. It doesn't use a tunnel: your project is served from your computer to devices on your own network, and nothing goes through a server on the internet. The QR code is made on your computer too.
- Click 📱 Mobile in the status bar, or run Mobile Serve: Show Phone URL from the Command Palette.
- Pick Start ‹your project› on your network (see below). If your dev server is already running, you can pick it under Running in this project instead, or enter its port.
- Scan the QR code with the device's camera, or type in the URL. The device has to be on the same network as your computer.
- When you're done, click 📱 Close Mobile in the status bar. It stops what Mobile Serve started, and puts back anything it made reachable from your network.
The panel also shows whether the server is listening on that address (checked from your computer, so a firewall can still block other devices), and lists other addresses to try if your computer is on more than one network.
Mobile Serve looks at each open workspace folder and starts it the way that suits it:
- Vite, Astro, Nuxt, Next.js, Angular CLI, webpack-dev-server and Vue CLI: it runs your
package.json'sdevscript (orstart, orserve) in a terminal, with the flags that make the tool listen on your network, for examplenpm run dev -- --host --port 5173 --strictPort. It uses the tool's usual port when it's free, so the address stays the same between runs. A script that already listens on your network (vite --host,next dev -H 0.0.0.0) only gets the port. Close Mobile, Ctrl+C or closing the terminal stops it. The script has to start the tool's dev server (vite,next dev,ng serve,webpack serve…): scripts that build or run a production server (next start,vite preview) aren't offered. Tested with Vite and Angular CLI so far. The others should work the same way, but haven't been tried yet; please open an issue if one doesn't. - Plain HTML, CSS and JavaScript: a folder with an
index.htmland no build step is served by Mobile Serve itself, on port 5600. Like Go Live, it reloads the page on every device when you save, and swaps the stylesheets in place when only CSS changed. Apackage.jsonwhose only server is a static file server (live-server,http-server,serve…) counts as plain HTML too.
When the folder itself can't be started, Mobile Serve looks up to two folders deep for projects with such a dev script and offers each one, by its path: Start applications/web on your network. That covers a web app next to its API, or the apps in a monorepo. Whatever the web app needs besides (the API, a database) you start yourself, as usual.
Projects it doesn't know how to start (a script that runs several commands, Django, Rails…) can still be shown: start them yourself and pick them from the list, or enter the port.
Most dev servers only accept connections from your own computer by default, so other devices can't reach them. Mobile Serve tells you when that's the case and helps you fix it:
- Vite, Astro, Nuxt, Next.js, Angular CLI, webpack-dev-server and Vue CLI: it reads your
package.json, shows the command that restarts the server on your network (for examplenpm run dev -- --host), and can restart it for you, in the terminal it was running in. It only offers this when the server was started with apackage.jsonscript (npm run dev,pnpm dev, …), that script runs just that one tool, and the tool is the one that's running. - Live Server: it can switch Live Server's host setting to
0.0.0.0for this workspace. It never changes the setting for all of VS Code, so open the folder you're serving first. The setting is saved in the workspace settings (usually.vscode/settings.json), so take care not to commit it. - Docker: container ports aren't tied to a project folder, so enter the port. A port published on
127.0.0.1only has to be published on all interfaces instead (-p 3000:3000). - Anything else: it shows example commands, and you can still show the QR code anyway.
The page runs in the other device's browser, so it makes its requests from that device. Apps that call an API or backend sometimes need a small change:
- Requests to
localhost. On another device,localhostmeans that device itself. A front end that callshttp://localhost:8000/apiwill fail. Use relative URLs (/api) together with your dev server's proxy (for example Vite'sserver.proxy), or use your computer's network address. - The backend only listening on localhost. If the page calls your API directly, the API server needs to listen on your network too, just like the dev server.
- CORS. The page's origin becomes something like
http://192.168.1.20:5173instead ofhttp://localhost:5173. A backend that only allowslocalhostwill reject the requests. A dev server proxy avoids this, because the browser then only talks to one origin. - Cookies and sign-in. Cookies set for
localhostdon't apply to the network address, and cookies markedSecurearen't saved over plainhttp. OAuth providers usually reject redirect URLs that aren't registered, so sign-in flows may need the network address added. - Browser features that need HTTPS. Browsers only treat
localhostas secure. On a network address overhttp, features such as service workers, camera and microphone, geolocation, the clipboard API andcrypto.subtleare unavailable. Serve over HTTPS to test them on another device (for example with@vitejs/plugin-basic-ssl). Mobile Serve detects HTTPS and shows anhttps://address; the device's browser will ask you to accept a self-signed certificate.
- VS Code 1.82 or newer.
- macOS or Linux to detect running servers (it uses
lsof, which some Linux distributions don't install by default). On Windows, starting your project works, and you can type in the port of a server that's already running. - The other device and your computer on the same network. On macOS, allow incoming connections if the firewall asks.
- With Remote SSH, WSL or Dev Containers, the addresses shown belong to the remote machine, which other devices may not be able to reach. The panel warns you when this applies.
Making a server reachable from one device makes it reachable from every device on that network.
Avoid doing this on public or untrusted Wi-Fi, and stop sharing when you're done: dev servers aren't
built to face a network, and Live Server serves every file in the folder, .env and .git included.
Mobile Serve's own server for plain HTML is more careful about what it serves: never files or folders whose name starts with a dot, nor anything outside the folder. Everything else in the folder can still be opened by anyone on the network who asks for it by name. That sharing takes one click doesn't make it something to think less about: check what's in the folder, and which network you're on, before you share.
Close Mobile undoes what Mobile Serve changed: it stops a server it started, restarts a server it restarted with the original script, and puts Live Server's host setting back (stopping Live Server if it's running). A server that was already reachable before Mobile Serve touched it is left alone; stop it yourself.
Closing VS Code puts Live Server's setting back too, since Live Server stops with it. If VS Code was force quit or crashed, that happens the next time you open the workspace.
In Restricted Mode (untrusted workspaces) the extension won't start or restart servers for you,
because that runs scripts from the project's package.json. Plain HTML folders can still be served.
Run Mobile Serve: Show Log from the Command Palette (or click Show Log on an error) to see what Mobile Serve did: the servers it found, what it started or stopped, and what went wrong. Paste it into an issue, together with your operating system and how you started your project. The log contains folder paths and process IDs, so look it over first. It stays on your computer until you paste it somewhere.
For more detail, run Developer: Set Log Level…, choose Mobile Serve and then Debug.
Mobile Serve is MIT-licensed. The packages bundled into the extension are listed with their licenses
in dist/THIRD_PARTY_NOTICES.txt, which the build generates.
The icon is based on "Mobile Signal" from Dazzle Line Icons by Dazzle UI, licensed under the CC Attribution License. It was modified for this logo.
"QR Code" is a registered trademark of DENSO WAVE INCORPORATED.
See CONTRIBUTING.md for how to build and test the extension.
