How to Test a Local PWA on a Physical Phone
Test service workers, installation, offline caching, updates, and Web Push on a real phone through a Localtonet HTTPS tunnel.
In this article 11 sections
Validate your PWA where its browser, installation flow, storage, and offline experience actually run
Desktop device emulation is useful, but it cannot fully reproduce how a Progressive Web App behaves on a physical phone. This guide shows how to prepare a locally hosted PWA, verify it on the development computer, publish it through a Localtonet HTTP tunnel, and test it from a public HTTPS origin on Android or iPhone. It covers installation, remote inspection, state resets, offline checks, the service worker update lifecycle, Web Push, troubleshooting, and teardown. An HTTPS tunnel provides connectivity and a secure origin. Browser-specific PWA eligibility and installation behavior still depend on your application and the phone's browser.
📋 What's in this guide
Why test a local PWA on a physical phone?
A Progressive Web App is a web application that can use browser and operating-system capabilities beyond an ordinary page. Depending on the browser, operating system, application, and permission state, it may register a service worker, cache resources, launch from the Home Screen or app launcher, use a standalone display mode, or receive push messages. These behaviors involve the actual mobile browser, network stack, storage policy, permission model, and installation surface.
Responsive mode in desktop developer tools can reveal layout breakpoints, viewport mistakes, and touch-target problems. It does not turn the desktop browser into the phone's browser or reproduce every operating-system integration. It cannot fully validate the real installation flow, standalone-window behavior, physical keyboard behavior, safe-area insets, mobile storage constraints, background suspension, notification delivery, or the experience of returning to an installed app after the operating system has removed it from memory.
Testing through localhost introduces another important distinction. On your development computer, localhost refers to that computer. On a phone, it refers to the phone. If browser-facing code points to http://localhost:3000, opening the application on a phone does not redirect that request to your workstation. The browser attempts to reach port 3000 on the phone itself.
A private LAN address can make a development server reachable when both devices share a network, but plain HTTP on a LAN does not necessarily behave like a secure production origin. Service workers and many powerful browser capabilities are generally restricted to secure contexts, subject to browser-specific exceptions and policies. Browsers commonly grant special local-development treatment to loopback addresses on the same computer, so success on desktop localhost does not prove that an HTTP LAN address will behave the same way on a phone.
With Localtonet, our client runs on a device that can reach your development server and establishes an outbound connection to a Localtonet server. An HTTP tunnel points to the PWA's local IP address and port and gives it a public HTTPS address. We provide and renew the certificate, so the local service can stay on plain HTTP. This avoids inbound router port forwarding, firewall changes, VPN setup, and the need for a public IP address. The phone can open the assigned address over Wi-Fi or mobile data while the selected client is connected, the tunnel is running, and the local PWA process is available.
The request path looks like this:
Physical phone (Android browser or iPhone Safari)
|
| HTTPS request to the assigned public address (no port number)
v
Localtonet server (TLS ends here)
^
| Outbound connection opened by the Localtonet client
|
Connected Localtonet client
|
| Plain HTTP to the configured local IP address and port
v
Local PWA (for example 127.0.0.1 + your actual app port)
The phone never connects to the development computer's localhost. It connects to the public HTTPS address, and the request travels through the tunnel and the connected client to the local target you configured.
A Localtonet tunnel makes the local application reachable through HTTPS. It does not create a manifest, register a service worker, repair worker scope, make an app installable, grant notification permission, or guarantee support for a browser capability. A service worker is required for features that depend on one, including service-worker-controlled offline behavior, but it should not be described as a universal installation requirement for every current browser. Installability criteria and installation UI are browser-specific and can change.
Prerequisites and supported inspection combinations
Begin with a locally runnable PWA and a physical phone. The development machine must be able to start the application, and you must know the port it listens on. The Localtonet client must be installed on that machine or on another device that can reach the application's local IP address and port, and it must be connected with an AuthToken. If the client is not set up yet, follow the Quick start in our Localtonet documentation, which covers downloading the app for your operating system and connecting it. AuthTokens identify specific client devices and must not appear in screenshots, source code, test logs, browser recordings, or shared bug reports.
Know the exact command your project uses to build and start. There is no universal PWA startup command because projects use different frameworks, package managers, output directories, and preview servers. Use your project's documented command and verify its output before adding the tunnel. Some development environments disable production service workers or change caching behavior to reduce stale-development problems, so use a production-like build when evaluating installation, offline behavior, and updates.
The application must also implement the capabilities under test. For manifest checks, it needs a linked web app manifest. For service-worker and offline checks, it needs a service worker with the intended fetch, caching, or fallback behavior. For Web Push, it needs a browser-supported subscription flow, application backend, delivery path, and notification handling. The tunnel cannot supply missing PWA logic.
A random subdomain needs nothing extra. If you want a custom subdomain or your own domain for the test, our HTTP tunnel documentation states that these require balance on your account, and a custom domain additionally requires a domain added in DNS Manager.
Choose the desktop and phone combination
| Phone target | Inspection computer | Core requirements |
|---|---|---|
| Android Chrome | Windows, macOS, Linux, or ChromeOS with desktop Chrome | USB cable capable of data transfer, Android Developer options, USB debugging, authorization of the computer, and chrome://inspect |
| iPhone Safari | Mac with Safari | Data-capable cable or an already established supported device connection, device trust, Web Inspector enabled on iPhone, and Safari's developer features enabled on the Mac |
| Android browser without Chrome debugging support | Depends on the browser vendor | Installation and manual tests can still run, but desktop Chrome inspection may not expose every non-Chromium browser target |
| iPhone browser or Home Screen web app | Mac with Safari | Apple's Web Inspector is the primary supported inspection path; exact inspectable targets depend on the browser, iOS version, and current platform behavior |
Android remote inspection normally requires Developer options and USB debugging. Enabling Developer options varies by device manufacturer, but it commonly involves opening the phone's build-number entry in system settings and tapping it repeatedly until developer features are enabled. Then enable USB debugging under Developer options. Use a trusted development computer, and revoke debugging authorizations when they are no longer needed.
For iPhone Safari, use a Mac with a current Safari version. Connect the phone with a data-capable cable for the most predictable initial setup, unlock it, and accept the trust prompt if shown. On the iPhone, enable Web Inspector under Safari's advanced settings. Depending on the iOS release, Safari settings may appear directly under Settings → Safari or under Settings → Apps → Safari. On the Mac, enable Safari's developer features so the Develop menu or equivalent developer interface is available. Apple's current workflow is documented in the Safari Web Inspector instructions for iOS.
Android USB inspection requires Android Developer options and USB debugging. On iPhone, Safari website inspection primarily requires Web Inspector and a trusted connection to a Mac. Full iOS Developer Mode is generally associated with development-signed application workflows and is not normally the basic requirement for inspecting an ordinary Safari page. If a managed device, beta environment, or development workflow explicitly requests Developer Mode, follow the prompts and policies for that environment rather than enabling it unnecessarily.
Record the test environment
Record the phone model, operating-system version, browser and version, whether the application ran in a browser tab or installed mode, the public origin, the build identifier, and the initial storage state. Platform behavior changes over time, so a result from one device should not be generalized to every browser or operating-system release.
Define the required scenarios before testing. A useful plan separates a fresh browser visit, fresh installation, repeat launch with warm caches, upgrade from an older worker, offline launch, offline deep link, network recovery, and denied permission. This prevents every result from being collected in one already-warmed browser profile.
| Test state | What it reveals | Preparation |
|---|---|---|
| Fresh browser visit | Initial manifest fetch, first worker registration, first-load errors, and permission timing | Clear the tested origin's site data before opening it again |
| Fresh installation | Installation UI, icon and name presentation, launch URL, display mode, and first installed launch | Uninstall the previous PWA and clear the origin's browser data |
| Warm-cache launch | Repeat-launch behavior, cached shell operation, and stale-content risks | Visit online first and exercise the routes expected to be cached |
| Offline launch | App-shell availability, fallbacks, cached navigation, and uncached-route handling | Warm the intended cache, disconnect the device, then reload and relaunch |
| Upgrade from an older build | Worker update detection, waiting workers, cache cleanup, reload prompts, and state preservation | Install or visit an older build, then publish the changed build through the same tunnel (stopped and restarted if needed, never deleted) |
| Denied permission | Whether the app respects refusal and remains usable | Reset permission state where supported, deny the prompt, and repeat the workflow |
The assigned tunnel address is public while the tunnel is running. Do not expose production credentials, customer records, administrative tools, debug consoles, directory listings, secrets in source maps, or unsafe development-only endpoints. Apply authentication, authorization, and least privilege within the application whenever the test surface is not intended for unrestricted public access.
Verify the PWA locally before creating a tunnel
A tunnel should not be the first diagnostic step. Verify that the application runs on the development machine and identify the exact target IP address and port. If the local server is unavailable, Localtonet has nothing to forward to. If the worker or manifest already fails locally, an HTTPS origin may change secure-context behavior, but it will not repair incorrect files or application logic.
Start the intended PWA build
Run the project's documented development or production-preview command. For final PWA validation, prefer a build mode that resembles deployment because development servers may alter worker and cache behavior. Keep the process running throughout the test.
Open the local application
Visit the exact local address on the development computer. Confirm that the document, JavaScript, styles, icons, manifest, worker script, and required API requests load without unexpected errors.
Confirm the target IP address and port
Record the local target that the Localtonet client can reach. If the client runs on the PWA machine, this is usually 127.0.0.1 and the application's actual port. If the client runs elsewhere, use an address reachable from that client. Never copy an example port from another project.
Inspect browser-facing URLs
Check generated HTML, runtime configuration, API base URLs, authentication callbacks, WebSocket URLs, manifest references, icon URLs, and worker registration paths. Anything requested by the phone must resolve from the phone and must not unintentionally remain tied to desktop localhost.
Establish a local baseline
Record current console errors, worker state, manifest details, and expected online behavior. This baseline helps separate application failures from origin, proxy, or mobile-browser differences.
Use root-relative manifest and worker paths
Avoid hardcoding a development hostname into registration paths or cache keys unless that is intentional. Root-relative URLs such as /manifest.webmanifest and /sw.js follow the current origin, so the same markup works on localhost and on the public tunnel address. Absolute URLs remain tied to their encoded scheme and host. A minimal setup looks like this:
<link rel="manifest" href="/manifest.webmanifest">
// Register the worker from the site root so it can control the whole origin.
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then((registration) => {
console.log('Service worker registered, scope:', registration.scope);
})
.catch((error) => {
console.error('Service worker registration failed:', error);
});
});
}
Adjust the file names to match your build output. The important property is the leading slash: the browser resolves both URLs against whatever origin the page was loaded from.
Check worker paths and scope
Service worker scope is controlled by the worker script location, registration options, response headers, and browser rules. A worker registered from a root-level path can generally control a broader part of the origin than one placed in a nested directory. Confirm that every page intended to use the worker falls within the reported scope.
Check proxy-sensitive behavior
Through a public address, the externally visible scheme and host differ from the local upstream address. TLS ends at the Localtonet server, and the request then travels through the tunnel to your device, so your local service sees a plain HTTP connection even though the phone used HTTPS. Some frameworks need carefully scoped trusted-proxy or public-origin configuration to generate correct absolute URLs and secure cookies. Do not enable broad proxy trust without understanding its security effect. Inspect redirects, links, cookie behavior, canonical URLs, and callbacks through the public address.
The Host header deserves particular attention. Development servers, frameworks, and virtual-host configurations often decide how to respond based on the Host value they receive. Our HTTP tunnel documentation has a dedicated section on the Host header that explains how an HTTP tunnel handles it. Read that section of the HTTP tunnel documentation before diagnosing host-related failures, because whether your local server sees the public tunnel hostname or a local value determines which host-check, virtual-host, and URL-generation settings apply to you. We do not restate the exact behavior here; confirm it against the current documentation and against what your server actually logs.
Tunneling the frontend does not automatically expose a separate local API. Browser requests execute on the phone. An API call to localhost targets the phone, while a private LAN address may be unreachable over mobile data. Use a phone-reachable API origin appropriate to the application and configure cross-origin, cookie, and authentication policies deliberately.
Create a Localtonet HTTP tunnel for the PWA


After the PWA works locally, publish it with an HTTP tunnel. The sequence below follows our current HTTP tunnel documentation. Before you start, make sure the Localtonet client is installed on the device and connected with an AuthToken, and that the PWA is running on a port you know.
Choose the URL type
| URL type | Address you get | Needs |
|---|---|---|
| Random subdomain | A generated name on the selected domain, in the form https://<RANDOM_NAME>.localto.net |
Nothing extra |
| Custom subdomain | The name you type in Subdomain, for example https://myapp.localto.net. Letters, digits, and hyphens are allowed. |
Balance |
| Custom domain | A domain of your own, selected in Domain | Balance and a domain added in DNS Manager |
For PWA testing, any of the three works as long as you keep the same tunnel for the whole sequence. A random subdomain is enough for most install, offline, and upgrade runs because it does not change when you stop and start the tunnel.
Create and start the tunnel
Open the HTTP page
In the dashboard, open My Tunnels › HTTP and select Create HTTP Tunnel to open the form.
Choose the URL type
Select Random subdomain, Custom subdomain, or Custom domain as described in the table above. Random subdomain needs nothing extra. Custom subdomain requires balance. Custom domain requires balance and a domain you have added in DNS Manager.
Choose the device and the region
In Device token, select the token used by the Localtonet app on the device that can reach the PWA. In Server region, choose a region close to that device for lower latency. Treat the token as a secret and never place it in screenshots, source control, or test artifacts.
Enter the local address and create the tunnel
Fill in Domain (localto.net or one of your own domains; for Custom domain the list contains only your own domains), Subdomain (Custom subdomain only), Local IP address (use 127.0.0.1 for the same device; the form accepts an IPv4 or IPv6 address or localhost), and Local port (the port the PWA listens on, from 1 to 65535). Select Create tunnel. The tunnel appears under Your tunnels as Tunnel # followed by its ID.
Start the tunnel
Select the start button in the Actions column. When the tunnel runs, its address in the URL column becomes a link. If the Localtonet app for that token is offline, a dialog tells you so: start the app, or select Start anyway and the tunnel goes live when the app connects.
Verify the address on desktop, then on the phone
Open the address from the URL column in a desktop private window first. A private window has no prior cookies, workers, or cached files for that origin, so it is a quick way to catch routing, redirect, asset, cookie, host-check, and mixed-content failures before involving the phone. When the page and its manifest and worker load cleanly there, open exactly the same address in the target phone's browser.
How the public address behaves
https:// followed by the host name in the URL column. Visitors open it like any other website, with no port in the URL.
The tunnel is available only while the selected client is connected and the tunnel is running. If the PWA process stops, requests can reach the tunnel but cannot be completed by the local target. If the client disconnects or the tunnel stops, the public test path becomes unavailable until both are back.
Service workers, Cache Storage, permissions, push subscriptions, cookies, site data, and installed-app identity are all associated with an origin. Because an HTTP tunnel keeps its subdomain until it is deleted, you can stop the tunnel at the end of a session and start it again later without changing the origin. Deleting the tunnel and creating a new one gives you a new address, which the browser treats as a different origin: the installed app, its worker, and its caches belong to the old origin and no longer apply. Keep one tunnel for an entire install, offline, upgrade, or push sequence, and delete it only when that sequence is finished.
Our HTTP tunnel documentation includes a section titled "The warning page on the Free plan", which describes a warning page associated with HTTP tunnels on the Free plan. Read that section for the exact conditions under which it appears and how it can be handled, since we do not restate those details here. Plan for it in PWA testing: any interstitial page served before your application can change what the first visit looks like, can sit between the browser and the first document load, and can interfere with automated test scripts that expect your page immediately. Whether it also affects subresource requests such as the manifest or the service worker script is not stated in the excerpt of the documentation we relied on, so verify it in the Network panel during your first desktop check rather than assuming either way.
Test service worker registration, scope, and lifecycle

Once the phone loads the PWA through HTTPS, test the worker as a lifecycle rather than checking only whether registration resolved. A registered worker can still have the wrong scope, fail installation, remain waiting, serve stale files, or never control the current document.
Registration and control
Start with a defined clean state and load the public URL. Confirm that the worker script returns successfully and that registration produces no console error. Then determine whether the page is controlled. A first visit can register a worker without immediately placing the current page under its control. A later navigation or reload may be necessary, depending on the lifecycle and application code.
Inspect the active worker's script URL and scope. Navigate to a route inside the intended scope and, if the design limits coverage, another route outside it. This detects workers placed too deeply in the URL hierarchy or registered with an unexpected scope.
Console checks for a remote phone
Once a remote-inspection session is open (see the debugging section below), you can paste these standard browser API calls into the console attached to the phone's page. They only read state, so they are safe to run repeatedly.
// Is this a secure context? Service workers need one.
console.log('Secure context:', window.isSecureContext);
// Which registration covers this page, and what state is each worker in?
navigator.serviceWorker.getRegistration().then((registration) => {
if (!registration) {
console.log('No service worker registration for this page');
return;
}
console.log('Scope:', registration.scope);
console.log('Installing:', registration.installing && registration.installing.state);
console.log('Waiting:', registration.waiting && registration.waiting.state);
console.log('Active:', registration.active && registration.active.scriptURL);
});
// Is the current document actually controlled by a worker?
console.log('Controlled by:', navigator.serviceWorker.controller
? navigator.serviceWorker.controller.scriptURL
: 'none');
// Which Cache Storage caches exist for this origin?
caches.keys().then((keys) => console.log('Caches:', keys));
// Is the page running in an installed, standalone window?
console.log('Standalone:', window.matchMedia('(display-mode: standalone)').matches);
A registration with an active worker but a null controller usually means this is the first load after registration, or the page sits outside the worker's scope. A worker in the waiting slot means an update is installed but not yet active. Cache names that never change between builds suggest that cache versioning is not working as intended.
Install and activate behavior
During installation, verify that intended application-shell resources enter the correct cache. A worker can fail if a required precache request fails. Inspect network failures and cache contents instead of assuming that a visible registration means installation completed.
During activation, check whether obsolete cache versions are removed according to the application's policy. Deleting every unfamiliar cache can interfere with other components on the same origin, while never deleting old caches wastes storage and preserves obsolete responses. Cleanup must match the application's cache naming and deployment design.
Fetch handling and data safety
Test static assets, navigation documents, images, API responses, authenticated data, and real-time information separately. These resources do not necessarily belong under the same caching strategy.
| Resource type | Question to test | Failure to detect |
|---|---|---|
| Application shell | Can the core interface load after caching when the phone is offline? | A missing script or stylesheet produces a blank screen |
| Navigation documents | Do reloads and direct deep links receive the intended document or fallback? | In-app navigation works, but direct routes fail |
| Hashed static assets | Are build files cached and replaced consistently? | Old HTML references removed files or stale assets survive |
| API responses | Does the app use live, stale, fallback, or unavailable data as designed? | Changing or user-specific information remains cached too long |
| Images and fonts | Can optional assets be cached without blocking installation of the shell? | One optional failure breaks the complete precache operation |
| Authenticated content | Is cached information isolated after sign-out or account changes? | Private information remains visible on a shared device |
Offline functionality creates data-retention risk. Review whether authenticated pages, API responses, personal records, and account-specific media belong in Cache Storage or other browser storage. Test sign-out, account switching, permission changes, and data clearing. A successful offline response is not automatically a safe response.
Install the PWA and test standalone and offline behavior
Open the manifest through the public origin and verify that the browser can fetch and parse it. Check names, icons, start URL, scope, display behavior, and theme information against the application's intent. Installation requirements and browser UI vary by platform and release. A browser may use manifest information without presenting the same installation prompt or criteria as another browser.
Do not use the presence or absence of a service worker as a universal installation verdict. A worker remains central to service-worker-based offline behavior, push handling, and other worker features, but current installation eligibility is defined by each browser. Consult the current browser-focused PWA installation guidance and validate the exact browser under test.
Install on Android
Open the public origin in the target Android browser
Enter the assigned HTTPS URL directly and complete any in-app prerequisite needed for installation. Confirm that you are testing the intended browser, since Chrome, Edge, Samsung Internet, Firefox, and other browsers can expose different installation interfaces and capabilities.
Use the browser's installation action
In Chrome, look for an offered installation action or open the browser menu and choose the available wording, such as Install app or Add to Home screen. The exact label and whether the result is a fully installed web app or a shortcut depend on Chrome, Android, and the site's current eligibility.
Confirm the Android prompt
Review the displayed app name and icon, then confirm. If no installation action appears, inspect the manifest, browser console, current browser criteria, prior dismissal state, and whether the app is already installed.
Launch from the app launcher or Home Screen
Leave the browser and open the installed item from Android. Verify the start URL, icon, name, display mode, navigation, back behavior, rotation, keyboard-open layout, backgrounding, and resume behavior.
Google documents the current user-facing process in its Chrome web app installation instructions. Treat those instructions as version-sensitive because menu labels and the distinction between installation and a shortcut can change.
Add the PWA to the Home Screen on iPhone
Open the public HTTPS URL in Safari
Use Safari for the standard iPhone Home Screen flow. Load the intended start page and verify that it works before installing it.
Open Safari's Share menu
Tap the Share button. If Add to Home Screen is not immediately visible, scroll through the available actions or edit the action list according to the current iOS interface.
Choose Add to Home Screen
Review the proposed name and icon, then choose Add. The exact preview and available options depend on the iOS and Safari version.
Launch from the Home Screen
Leave Safari and tap the new Home Screen icon. Verify the start URL, display mode, authentication flow, internal and external links, safe-area layout, keyboard states, backgrounding, and resume behavior.
Apple maintains the current procedure in its iPhone guide for adding a website to the Home Screen. Safari does not need to present a Chromium-style automatic install prompt for the Home Screen flow to be available.
Test authentication and callbacks
Confirm that login does not redirect to an unreachable localhost address, lose session state, or strand the user in an unintended browser window. OAuth and other identity systems may require the exact public HTTPS callback origin to be registered. Because the tunnel address stays the same until you delete the tunnel, a callback you register once remains valid across stop and start cycles. Do not weaken callback validation to accommodate a temporary URL. Register only the intended test callback, use non-sensitive accounts, and remove temporary entries afterward.
Run the offline sequence
Begin with a defined storage state
Decide whether this is a clean-install, warm-cache, or upgrade test. Reset the site for a clean run or retain the older installation for an upgrade. Record the chosen state.
Load intended offline content while online
Visit the routes and features expected to work offline. Wait for the worker to activate and intended runtime caching to complete. One visit does not necessarily cache every route. Run caches.keys() from the remote console to confirm the expected caches exist.
Disconnect the phone
Disable Wi-Fi and mobile data, or use airplane mode with other network paths disabled. Confirm that the phone has not silently switched to another connection.
Reload and relaunch
Reload the browser page, close and reopen it, and launch the installed PWA from its icon. These paths can expose different navigation and lifecycle failures.
Exercise cached and uncached routes
Navigate through routes that should work offline, then deliberately request an uncached route or resource. The app should show its designed fallback rather than hanging or presenting an unexplained blank screen.
Restore connectivity
Reconnect and verify that the application recovers, refreshes stale information as intended, and processes any explicitly implemented queued work without duplication. Background synchronization support is browser-dependent.
Include a cold offline deep-link test. Cache the content your design promises to support, fully close the app, remain offline, and open a direct route. Single-page applications often pass in-app navigation tests but fail direct navigation because the server or worker does not provide the correct document fallback.
You can also simulate a server-side outage separately from a phone-side outage: keep the phone online but stop the tunnel from the dashboard. The phone still has a network connection, but requests to the origin fail. This is a different failure mode from airplane mode, and some apps that handle full offline state correctly still mishandle failed requests while the device reports being online. Start the tunnel again afterward; the address does not change.
Reset installed-app and site state for repeatable tests
Removing a Home Screen icon does not always clear the origin's cookies, Cache Storage, IndexedDB, worker registration, permissions, or other website data. Conversely, clearing browser data may not remove every installed launcher entry. For a reproducible clean-install test, remove the installed PWA and clear the tested origin's site data. Resetting the phone is the right way to start fresh; deleting and recreating the tunnel is not, because it changes the origin and leaves orphaned data for the old one on the device.
Reset an Android Chrome test
Uninstall the installed PWA
Long-press the app icon and choose the available app information or uninstall action, or open Android Settings, locate the installed web app in Apps, and uninstall it. If Chrome created only a shortcut, remove that shortcut from the Home Screen as well.
Open the origin's settings in Chrome
Open the public origin in Chrome, use the address-bar site controls, and open the available permissions or site settings interface. Choose the option to clear or reset the site's stored data and permissions when present. Chrome's exact labels vary by version.
Use Chrome settings if per-site controls are unavailable
Open Chrome Settings, then Site settings or Privacy and security, locate the tested site under stored data or all sites, and clear its data. Avoid clearing unrelated sites unless a full-browser reset is part of the test plan.
Verify the clean state
Reopen the origin and inspect it remotely. Confirm with getRegistration() and caches.keys() that old workers, caches, storage, permissions, and installed-app state no longer affect the new run.
Google's Chrome browsing-data documentation describes current data-clearing controls. Prefer a per-site reset when you need to preserve unrelated browser state.
Reset an iPhone Safari and Home Screen test
Delete the Home Screen web app
Touch and hold the Home Screen icon, choose the available removal action, and confirm deletion of the web app or bookmark. Wording varies by iOS version.
Open Safari website-data settings
Open Settings, then Safari, Advanced, and Website Data. On versions that group application settings, begin at Settings, Apps, Safari, then Advanced and Website Data.
Remove data for the tested hostname
Find the public tunnel hostname and delete its website data. Use the exact host tested during the sequence. Clearing all Safari history and website data is broader and may remove unrelated sessions, so use the per-site control when available.
Reopen and reinstall
Open the public URL in Safari again, verify the fresh visit, and repeat Share, Add to Home Screen, and launch from the new icon.
Clearing state proves that the newest build works from a fresh origin. It does not prove that an existing installation upgrades safely. Keep a separate device or scheduled test case with the older worker, caches, storage, and installed app intact, then publish the new build through the same tunnel at the same address.
Validate updates and Web Push behavior
Service worker and cache updates
An update test requires origin continuity. Install or visit an old build through one public HTTPS address, keep that address, modify the application, and serve the new build through the existing tunnel. Because an HTTP tunnel keeps its subdomain until you delete it, you can stop the tunnel while rebuilding and start it again afterward without breaking continuity. Deleting the tunnel and creating a new one produces a new origin and silently converts the exercise into a fresh-install test.
Make an observable but safe change, such as displaying a build identifier in a diagnostic area. Update the worker or assets using the project's normal build process, then revisit the app. The states below are the ones most often misread during this test:
1. Old worker (v1) is ACTIVE and controls every open page or installed window.
|
| Browser fetches sw.js and finds a byte-different script
v
2. New worker (v2) is INSTALLING: its install handler precaches v2 assets.
|
| Install succeeds
v
3. v2 is INSTALLED and WAITING. v1 still controls all clients.
(registration.waiting is set; navigator.serviceWorker.controller is still v1)
|
| All v1 clients close, OR the app calls skipWaiting() after the
| user accepts a reload prompt
v
4. v2 is ACTIVATING: its activate handler deletes obsolete v1 caches.
|
v
5. v2 is ACTIVATED. Pages are controlled by v2 after a navigation or reload,
or immediately if the worker calls clients.claim().
Use the console checks from the service worker section at each stage. A worker sitting in the waiting slot is normal behavior, not a failure: by default it waits until no open page or installed window is still controlled by the old worker. On a phone, an installed PWA running in the background can keep that old worker in control longer than you expect. Some applications show a reload notice and call skipWaiting() when the user accepts; others wait for all windows to close.
Judge the update by consistency, not just speed. The active document, scripts, styles, and caches must belong to compatible versions. A new document paired with obsolete assets, or an old document referencing removed assets, can break the application. Test with one tab, multiple tabs, a backgrounded installed app, and a return after the device has been idle.
If the application announces an update, verify that the notice appears at the intended time and does not create an endless reload loop. Test while a form contains unsaved work if updates could interrupt user activity. Cache cleanup should follow the application's versioning policy, and caches.keys() after activation should show only the caches the new version expects.
Web Push prerequisites
Web Push requires more than HTTPS. It depends on browser and operating-system support, notification permission, a service worker, application-side subscription handling, a push service, backend delivery, and notification interaction logic. Test the exact target browser and operating-system release.
On iPhone and iPad, the platform condition is specific. WebKit's announcement Web Push for Web Apps on iOS and iPadOS explains that, starting with iOS and iPadOS 16.4, Web Push is available to web apps that the user has added to the Home Screen. In practice that means the push flow must be tested from the Home Screen app, not from a regular Safari tab, and the permission request must come from a direct user interaction such as tapping a button. Because the installed app belongs to the tunnel's origin, keep the same tunnel through the whole push test.
Request notification permission in response to an appropriate user action and explain why notifications are useful. Test grant, denial, and dismissal. After denial, the application should remain usable and should not repeatedly pressure the user. The tunnel does not alter the browser's permission decision.
Feature-detect instead of checking browser names. A check like the following, run in the page or the remote console, shows what the current context actually exposes:
const pushReady =
'serviceWorker' in navigator &&
'PushManager' in window &&
'Notification' in window;
console.log('Push APIs available:', pushReady);
if ('Notification' in window) {
console.log('Notification permission:', Notification.permission);
}
On an iPhone, expect this to differ between a Safari tab and the Home Screen app, which is exactly the distinction the WebKit announcement describes. Where supported, confirm that the subscription reaches the backend and is associated with the correct test account. Test delivery while the app is visible, backgrounded, and closed. Verify notification content and tap behavior. A notification link pointing to localhost, an obsolete hostname, or a route outside the intended scope can fail even if delivery succeeds.
HTTPS is a prerequisite for many PWA APIs outside special local-development contexts, but it is not proof of support. Feature-detect required APIs, verify current browser documentation for the release under test, and provide a usable fallback when push is unavailable or permission is denied.
Remotely inspect Android Chrome and iPhone Safari

Inspect Android Chrome with chrome://inspect
Enable Android Developer options and USB debugging
Enable Developer options using the procedure for the phone manufacturer, then enable USB debugging. Use a device and computer you are authorized to configure.
Connect the phone with a data-capable USB cable
Unlock the phone and connect it to the desktop. If the phone offers a USB mode, select one that permits data transfer rather than charge-only operation.
Authorize the debugging computer
Accept the phone's USB debugging prompt. Confirm the computer's key only if you trust that machine. If the prompt does not appear, disconnect and reconnect, check the cable and USB mode, or revoke old USB debugging authorizations and try again.
Open the PWA in Chrome on Android
Open the assigned public HTTPS URL on the phone. Keep the relevant tab visible initially so it is easy to identify.
Open chrome://inspect/#devices on the desktop
In desktop Chrome, open chrome://inspect/#devices and ensure Discover USB devices is enabled. The authorized phone and its inspectable Chrome tabs should appear.
Select Inspect for the public PWA page
Choose Inspect beside the correct tab. Use Console, Network, Application, Storage, Manifest, Service Workers, Cache Storage, IndexedDB, Cookies, and Security panels as appropriate. Keep the phone unlocked if the connection becomes unavailable when locked.
Revoke debugging access after the session
Disconnect the cable and disable USB debugging when it is not needed. On shared or temporary computers, revoke the computer's debugging authorization from Android Developer options.
Google maintains the current procedure in its Chrome DevTools remote-debugging documentation. Desktop and phone Chrome versions that are far apart can cause inspection problems, so update them or follow Google's compatibility guidance if the device appears but a debugging session does not open.
Inspect iPhone Safari from a Mac
Enable Web Inspector on the iPhone
Open Safari's Advanced settings and enable Web Inspector. Depending on iOS, the path begins at Settings, Safari or Settings, Apps, Safari.
Enable Safari developer features on the Mac
In Safari settings, enable the option that exposes web developer features or the Develop menu. The wording and location can vary by macOS and Safari version.
Connect, unlock, and trust the iPhone
Connect the iPhone to the Mac using a data-capable cable. Unlock it, accept Trust This Computer if shown, and complete any required device passcode confirmation.
Open the public PWA origin on the iPhone
Load the assigned HTTPS address in Safari. For an installed-mode problem, reproduce it from the Home Screen app and look for an inspectable target representing that web content if the current platform exposes it.
Choose the iPhone and page from Safari on the Mac
Open Safari's Develop menu or current device-inspection interface, choose the connected iPhone, then select the relevant page or web app target.
Inspect the live mobile page
Use the Web Inspector console, network timeline, resources, storage, and worker-related tools available in that Safari release. Reproduce the issue on the phone while watching requests and errors on the Mac.
If the iPhone does not appear, confirm that both devices are unlocked, the cable supports data, the trust relationship is established, Web Inspector is enabled, and Safari developer features are enabled. Managed-device policy can also restrict inspection.
Capture useful evidence
Reproduce the issue with a visible build identifier and record the public origin, route, initial storage state, worker status, device model, operating system, browser version, installed or tab mode, and relevant errors. Do not include Localtonet tokens, session credentials, authorization headers, push subscription secrets, private API payloads, or customer data.
Troubleshoot the public URL
Our HTTP tunnel documentation ends with its own Troubleshooting section; work through it alongside the checks below, which follow directly from the documented tunnel behavior:
- The address in the URL column is not a link. The tunnel exists but is not running. Select the start button in the Actions column. Creating a tunnel does not start it.
- You saw the "app is offline" dialog and chose Start anyway. The tunnel goes live only when the Localtonet app for that token connects. Start the app on the device that owns the selected Device token.
- The tunnel runs but the page does not load. Confirm that the PWA still loads locally, and that Local IP address and Local port match the running server exactly. A running tunnel cannot serve an upstream process that has stopped or listens on a different port.
- The wrong device token was selected. The tunnel forwards from whichever device owns the selected token. If that device cannot reach the PWA, requests fail even though the tunnel is running.
- You typed a port into the URL. The public address has no port number. Open it exactly as shown in the URL column.
- The address changed. An HTTP tunnel keeps its subdomain until you delete it. A different address means a different tunnel, and therefore a different origin on the phone.
If the client runs on another device, confirm that it can reach the configured target. A server bound only to loopback is available to a client on the same machine but not automatically to another machine. Changing the bind address can increase LAN exposure, so make that choice deliberately and apply appropriate firewall rules.
Troubleshoot dev-server host checks
A very common pattern is that http://localhost:5173 works on the desktop, the tunnel is running, but the public URL returns an error page or a "blocked request" message from the development server itself. Many development servers validate the Host header of incoming requests as protection against DNS rebinding and reject hostnames they do not recognize. Check your server's console output for a message naming the rejected host, and check the Host header section of our HTTP tunnel documentation to understand which host value your server receives through the tunnel.
In Vite, this check is controlled by server.allowedHosts. According to the Vite documentation, localhost, domains under .localhost, and IP addresses are allowed by default, other hostnames must be listed, and a value beginning with a dot allows that domain and all of its subdomains. The preview server has a matching preview.allowedHosts option that defaults to the server.allowedHosts value. Allow only the specific tunnel hostname you are testing, not every host:
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
server: {
// Replace with the exact host name shown in the URL column of your tunnel.
allowedHosts: ['your-tunnel-name.localto.net'],
},
})
Vite also accepts true to allow any host, and a leading-dot entry such as .localto.net would allow every subdomain of that domain. Both disable protection far more broadly than a single PWA test requires, so avoid them. Because the tunnel address stays the same until you delete the tunnel, a single explicit hostname remains valid for the whole test campaign. webpack-dev-server has a similar devServer.allowedHosts option; for other frameworks, consult that framework's own documentation for its host-check setting rather than guessing.
If the page loads but hot reload does not, remember that WebSocket connections pass through an HTTP tunnel, so the tunnel is not the usual cause. More often the hot-reload client is trying to connect to the dev server's local port on the public hostname, while the public address has no port. Frameworks expose options for this; in Vite, the documented server.hmr settings, including clientPort, control where the browser's HMR client connects. Inspect the failing WebSocket URL in the Network panel before changing anything, and remember that final PWA validation should use a production-like build anyway.
Troubleshoot assets, workers, installation, and login
When the document loads but assets fail, inspect the requested URLs. Absolute paths may still reference localhost, a LAN address, an old hostname, or plain HTTP. Mixed-content rules can block insecure resources from an HTTPS page. Correct the browser-facing origins rather than disabling browser security.
If the worker does not register, verify secure-context status with window.isSecureContext, then check the worker response, redirects, authentication interception, script syntax, requested scope, and browser support in the current mode. If it registers but does not control the page, compare the document URL with the reported scope, inspect active and waiting workers, and account for the first-load lifecycle. On the Free plan, also rule out the warning page described in our documentation by checking in the Network panel that the worker script and manifest requests return your files rather than another HTML response.
If installation is not offered, validate the manifest, icon responses, start URL, scope, display configuration, HTTPS origin, console, prior dismissal state, and whether the app is already installed. Then check the exact browser's current installation model. Safari's Add to Home Screen path should not be judged by the presence of a Chromium-style prompt.
If login or redirects fail, inspect whether the application generates URLs from its local upstream host rather than the public origin. Review cookie domain, path, Secure, and SameSite behavior. Confirm that the identity provider recognizes the exact HTTPS callback and that browser-facing configuration no longer points to localhost.
Operate the test safely and tear it down cleanly
Expose only the local web port needed for the PWA, not a database, inspector, administration service, or unrelated port. Keep test accounts separate from production accounts and use non-sensitive data. Privileged routes must retain their own authentication and authorization because possession of a tunnel URL is not authorization.
Before sharing the address, open it in a signed-out browser and verify what an unauthenticated visitor can access. Remove verbose error pages and secrets from client-side configuration. Review source maps, diagnostics, test endpoints, sample credentials, and development utilities. A local development server can contain conveniences that are inappropriate on a public origin, and host-check exceptions such as allowedHosts entries should be removed from shared configuration when the test ends.
Between sessions of the same test campaign, stop the tunnel rather than deleting it. Stopping makes the public path unavailable while preserving the address, so installed apps, worker registrations, permissions, and registered callbacks on your test phones keep pointing at a valid origin when you start it again. When the campaign is finished and the configuration is no longer needed, delete the tunnel, accepting that a future tunnel will have a new address. Stop the local application and client when appropriate. Creating, starting, stopping, and deleting a tunnel are distinct lifecycle actions.
Remove temporary accounts, callback registrations, and push subscriptions created only for the test. On a shared phone, uninstall the PWA and clear the origin's site data, caches, permissions, and stored credentials. Revoke Android USB debugging access or disconnect the iPhone trust relationship when required by your device-management policy.
Preserve only sanitized evidence such as the build identifier, device model, operating-system version, browser version, expected result, actual result, and non-sensitive console or network details. Never preserve an AuthToken, session cookie, authorization header, private endpoint, or customer payload in a ticket.
A clean reset proves that the latest build works without old state. An upgrade test proves that existing users can move from old workers and caches to the new version. A complete release check needs both, and both depend on keeping the same tunnel address throughout.
Frequently asked questions
Why can I not open desktop localhost directly from my phone?
Every device has its own loopback interface. On the phone, localhost means the phone, not the development computer. A Localtonet HTTP tunnel gives the phone a public HTTPS address that forwards to the local target reachable by the selected client.
Does the tunnel address change when I stop and start the tunnel?
No. An HTTP tunnel keeps its subdomain until you delete the tunnel, and stopping and starting it does not change the address. Only deleting the tunnel and creating a new one gives you a different address. Stop the tunnel between install, offline, and upgrade runs so the phone keeps testing the same origin.
Do I need to run HTTPS on my local server?
No. Visitors reach the HTTP tunnel over HTTPS with a certificate that Localtonet provides and renews. TLS ends at the Localtonet server, so your local PWA can keep serving plain HTTP. The phone still sees a secure origin.
Why does the tunnel URL fail while localhost works?
Start with the tunnel state: confirm it is started and its client is connected. If it is, the usual cause is a development server rejecting an unfamiliar Host header. In Vite, add only your exact tunnel hostname to server.allowedHosts (or preview.allowedHosts for the preview server), and review the Host header section of our HTTP tunnel documentation.
Does an HTTPS tunnel automatically make my PWA installable?
No. HTTPS provides a secure public origin needed by many capabilities, but installation depends on the application and browser. Validate the manifest, icon responses, start URL, scope, browser-specific criteria, and available installation interface.
Is a service worker always required to install a PWA?
It should not be treated as a universal installation requirement. Browser criteria differ and change over time. A service worker is still required for application behavior that depends on one, including worker-controlled offline responses and push event handling.
Can I test Web Push on an iPhone?
On iOS and iPadOS 16.4 and later, Web Push is available to web apps added to the Home Screen, as described in WebKit's announcement. Add the PWA to the Home Screen from the tunnel address, test from that installed app, request permission from a user action, and feature-detect the push APIs rather than assuming support.
Can I test over mobile data instead of the same Wi-Fi network?
Yes. The public address is internet-reachable while the selected Localtonet client is connected, the tunnel is running, and the local target is available. This lets the phone test through mobile data without sharing the development computer's LAN.
Can Windows remotely inspect iPhone Safari?
Apple's primary supported Safari Web Inspector workflow uses Safari on a Mac connected to the iPhone. A Windows computer can host the PWA and Localtonet client, but you need an appropriate Mac for the standard iPhone Safari inspection workflow.
Is deleting the Home Screen icon enough for a clean test?
Not reliably. Remove the installed app or shortcut and clear the tested origin's website data. This prevents old cookies, workers, caches, IndexedDB records, and permissions from contaminating a fresh-install result.
Should I test a development server or a production build?
Use a development server for rapid layout and interaction checks. Use a production-like build and serving mode for final installation, caching, offline, and update validation because frameworks can disable or alter service workers during development.
Does exposing the frontend also expose its local API?
Not automatically. An HTTP tunnel forwards to its configured local target. A separate API must have its own phone-reachable and secure architecture. Browser-facing API URLs must not unintentionally point to the phone's localhost.
Is clearing browser data enough to test an update?
No. Clearing data tests a fresh installation. To test an update, establish an older worker and cache state at the same origin, serve the new build through the same tunnel, and observe detection, waiting, activation, cleanup, reload behavior, and compatibility with existing clients.
Test your local PWA on a real phone
Run your intended PWA build, connect the device that can reach it with our client, and create an HTTP tunnel. You get a public HTTPS address with a certificate we provide, an address that survives stop and start cycles, and no inbound router port forwarding, firewall changes, VPN setup, or public IP address.
Get Started Free →Corrections & updates
Substantive changes approved by the Localtonet editorial team are listed transparently below.
Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.