Android live debugging

Set up the ADB bridge (works alongside Android Studio)

One small helper lets SQLite Viewer and Android Studio use your phone at the same time. Download it, put it in place, make it start by itself, and you are done.

Open the viewer

Do I need the bridge?

Often not. SQLite Viewer can talk to your phone directly over USB (USB direct mode in Chrome or Edge), with nothing to install. The bridge is for one situation: Android Studio (or another ADB tool) is already using the phone. Only one program can own the USB connection, so the bridge lets SQLite Viewer share Android Studio's ADB server instead. Both then work at the same time.

USB directADB server (bridge)
Install anything?NoYes, once (one click on Windows)
Works with Android Studio open?No, it must be closedYes
BrowserChrome or Edge on desktopAny modern browser
Needs ADB on the PC?NoYes (Android Studio or Platform Tools)

Windows: one-click installer

  1. Download the installer. In SQLite Viewer, open Live Android, choose ADB server and click Download the installer (Windows).
  2. Keep the file. Chrome may say the file cannot be verified. Choose Keep (or Download unverified file). The file is plain text, so you can open it in Notepad to read exactly what it does.
  3. Run it once. Double-click Install-ADB-Bridge.cmd. If Windows shows Windows protected your PC, click More info, then Run anyway.
  4. Come back to the page. The installer builds the bridge on your PC, makes it start by itself every time you sign in, and starts it. SQLite Viewer notices it within a few seconds. Click Connect through bridge.

The bridge is installed in %LOCALAPPDATA%\SQLiteViewerBridge and a shortcut in your Startup folder starts it at sign-in. To remove it, run uninstall.cmd from that folder.

Any system: set it up with Python

  1. Install Python 3. Download it from python.org. On Windows, tick Add Python to PATH in the installer. Most Linux systems already have python3. macOS does not include it by default: the first time you type python3, macOS offers to install Apple's Command Line Tools (accept it), or you can use the installer from python.org.
  2. Download the file. Download adb-bridge.py. Your browser saves it in the Downloads folder. If it ends in .txt, rename it to adb-bridge.py.
  3. Copy it to its permanent place. Open a terminal (any folder works, the commands use full paths) and run the command for your system. It creates the folder and copies the file into it. If your browser saved the file somewhere other than Downloads, change that part of the command.
  4. Make it start by itself. Run the command for your system. It sets up the start-at-sign-in entry for the file where you copied it, and starts the bridge now.
  5. Connect. Go back to SQLite Viewer. It finds the bridge by itself. Click Connect through bridge.

Step 3: copy the file (run once)

Windows (PowerShell, press the Windows key, type powershell, press Enter):

New-Item -ItemType Directory -Force "$env:LOCALAPPDATA\SQLiteViewerBridgePython" | Out-Null; Copy-Item "$env:USERPROFILE\Downloads\adb-bridge.py" "$env:LOCALAPPDATA\SQLiteViewerBridgePython\adb-bridge.py"

Windows (Command Prompt, press the Windows key, type cmd, press Enter):

mkdir "%LOCALAPPDATA%\SQLiteViewerBridgePython" & copy "%USERPROFILE%\Downloads\adb-bridge.py" "%LOCALAPPDATA%\SQLiteViewerBridgePython\adb-bridge.py"

macOS (Terminal):

mkdir -p "$HOME/Library/Application Support/SQLiteViewerBridge" && cp "$HOME/Downloads/adb-bridge.py" "$HOME/Library/Application Support/SQLiteViewerBridge/adb-bridge.py"

Linux:

mkdir -p "$HOME/.local/share/sqliteviewer-bridge" && cp "$HOME/Downloads/adb-bridge.py" "$HOME/.local/share/sqliteviewer-bridge/adb-bridge.py"

Step 4: start it by itself at sign-in (run once)

Windows (PowerShell):

python "$env:LOCALAPPDATA\SQLiteViewerBridgePython\adb-bridge.py" --add-to-startup

Windows (Command Prompt):

python "%LOCALAPPDATA%\SQLiteViewerBridgePython\adb-bridge.py" --add-to-startup

macOS:

python3 "$HOME/Library/Application Support/SQLiteViewerBridge/adb-bridge.py" --add-to-startup

Linux:

python3 "$HOME/.local/share/sqliteviewer-bridge/adb-bridge.py" --add-to-startup

On Windows this creates a hidden shortcut in your Startup folder, on macOS a Launch Agent, and on Linux a systemd user service (or a desktop autostart entry). None of them needs administrator rights. Keep the file where it is; if you move it, run the command again.

In a hurry? One command does steps 3 and 4

Open a terminal in the folder where you downloaded the file and run:

python adb-bridge.py --install      # Windows
python3 adb-bridge.py --install     # macOS and Linux

Prefer to add it to Startup by hand?

Windows: press Win + R, type shell:startup and press Enter. In the folder that opens, right-click, choose New → Shortcut and set the location to:

pythonw "%LOCALAPPDATA%\SQLiteViewerBridgePython\adb-bridge.py"

Name it SQLite Viewer ADB Bridge. Using pythonw instead of python keeps the black window away. Sign out and in, or double-click the shortcut to start it now.

macOS: the command above creates ~/Library/LaunchAgents/com.sqliteviewer.adbbridge.plist. Linux: it creates ~/.config/systemd/user/sqliteviewer-bridge.service (or ~/.config/autostart/sqliteviewer-bridge.desktop). Writing those files by hand is possible, but the command is safer.

Check, stop and remove it

python adb-bridge.py --status                  # is it running?
python adb-bridge.py --remove-from-startup      # stop starting at sign-in (keeps the file)
python adb-bridge.py --uninstall                # stop it and delete everything
# add the full path to the file if you are not in its folder, as in the commands above

Do I have ADB? Install it if not

The bridge relays to ADB (Android Platform Tools). Android Studio already includes it, so if you use Android Studio you can skip this section. To check, open a terminal and run adb version. If the system does not know the command, install ADB with one of the commands below. SQLite Viewer also tells you when the bridge is running but cannot find ADB. The bridge looks for ADB on your PATH and in the usual Android Studio, winget, Homebrew and manual-download folders, so you do not need to change PATH, and it starts the ADB server for you.

Windows

Easiest (Windows 10 and 11, PowerShell or Command Prompt):

winget install --id Google.PlatformTools -e

No winget? Download it directly (PowerShell):

Invoke-WebRequest https://dl.google.com/android/repository/platform-tools-latest-windows.zip -OutFile "$env:TEMP\pt.zip"; Expand-Archive "$env:TEMP\pt.zip" "$env:LOCALAPPDATA\Android\Sdk" -Force; Remove-Item "$env:TEMP\pt.zip"

The same in Command Prompt:

powershell -NoProfile -Command "Invoke-WebRequest https://dl.google.com/android/repository/platform-tools-latest-windows.zip -OutFile \"$env:TEMP\pt.zip\"; Expand-Archive \"$env:TEMP\pt.zip\" \"$env:LOCALAPPDATA\Android\Sdk\" -Force; Remove-Item \"$env:TEMP\pt.zip\""

Check that it worked (PowerShell):

& "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe" version

macOS

With Homebrew:

brew install --cask android-platform-tools

Without Homebrew:

mkdir -p "$HOME/Library/Android/sdk" && curl -L -o /tmp/pt.zip https://dl.google.com/android/repository/platform-tools-latest-darwin.zip && unzip -o /tmp/pt.zip -d "$HOME/Library/Android/sdk" && rm /tmp/pt.zip

Linux

Debian, Ubuntu, Mint:

sudo apt install adb

Fedora:

sudo dnf install android-tools

Arch, Manjaro:

sudo pacman -S android-tools

Any other distribution:

mkdir -p "$HOME/Android/Sdk" && curl -L -o /tmp/pt.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip && unzip -o /tmp/pt.zip -d "$HOME/Android/Sdk" && rm /tmp/pt.zip

Then prepare the phone

  1. On the phone open Settings → About phone and tap Build number seven times.
  2. Open Settings → Developer options and turn on USB debugging.
  3. Plug the phone in and tap Allow on the prompt. Running adb devices should list it as device.

Do I need to configure anything?

No. The bridge only accepts connections from the SQLite Viewer website, listens on your own computer only (127.0.0.1), and only relays to the ADB server on the same computer. Nothing is stored or sent anywhere else.

You only need a setting in two cases:

python "%LOCALAPPDATA%\SQLiteViewerBridgePython\adb-bridge.py" --add-to-startup --allow-origin https://your-address.example
python "%LOCALAPPDATA%\SQLiteViewerBridgePython\adb-bridge.py" --add-to-startup --port 5040

Allowed addresses are remembered in a file called origins.txt (one address per line) next to the bridge: Windows %LOCALAPPDATA%\SQLiteViewerBridge (installer) or %LOCALAPPDATA%\SQLiteViewerBridgePython (Python), macOS ~/Library/Application Support/SQLiteViewerBridge, Linux ~/.local/share/sqliteviewer-bridge.

Troubleshooting