Use your phone browser to control the AI coding agent on your PC, and transfer files between phone and laptop easily.
Python 3.10+ Google Antigravity License: MIT Platform: Windows Privacy: 100% Local
| π Overview | πΌοΈ Screenshots | ποΈ Architecture | ποΈ Couch Coding |
|---|---|---|---|
| π Quick Start | π ADB Pairing | π€ AI Integration | π Security |
| π οΈ Troubleshooting |
Antigravity 2.0 is a local AI coding assistant made by Google DeepMind. It runs directly on your computer (not in the cloud). It has full access to your laptop, so it can read and write files, scan your code structure, run terminal commands, and schedule background tasks.
But because it runs locally, you can only open it on your laptop (at localhost). Your phone browser cannot reach it by default.
GravityBridge is a secure local proxy tool. It lets you open a web page on your phone browser to connect to the AI agent on your laptop. Now you can write code and control your workspace from your phone.
GravityBridge puts the AI chat and a phone file explorer together in one single page on your mobile browser:
- ποΈ Couch Coding: Write code, run tests, and check git commits from your phone while sitting on the couch.
- πΈ Quick Mobile UI Debugging: Take a screenshot of a bug on your phone, pull it to your laptop via ADB in one tap, and ask the AI agent to fix the stylesheet immediately.
- π Wireless Phone Drive: Browse your phone
/sdcardfolders, select files with checkboxes, and copy them directly to your PC. - π Easy Multi-Tasking: Watch the AI agent running tasks in the chat window, and browse your phone storage files at the same time.
Note: All private IP addresses in these screenshots are blurred for safety.
| Feature & Description | Screenshot Preview |
|---|---|
| π¬ Antigravity Chat Control Google's Antigravity 2.0 AI agent on your laptop directly from your phone browser. Run shell commands, edit files, and check git status via chat. |
Antigravity Chat |
| π Sidebar & Task Management Slide out the sidebar menu to view your active workspace projects, check conversation logs, or manage background agent tasks. |
Sidebar and Tasks |
| π Phone Drive Explorer Browse your Android device's /sdcard storage in real-time.Select folders or files with checkboxes and wirelessly pull them to your PC in one tap. |
Phone Drive Explorer |
| π₯ Drag and Drop Upload Zone Upload files or directories directly from your PC browser and save them in the DeviceUploads/ folder on your laptop.Supports automatic extraction of uploaded .zip archives. |
Upload Zone |
| π Connected Devices Log Keep track of all active client sessions (both phone and PC) connected to the proxy, including browser details and connection time. |
Connected Devices |
| π Lock Screen The entry page to the portal. Enter the AUTH_PIN configured in your .env file to unlock the session.Includes brute-force protection (CAPTCHA and temporary IP block after 5 failed attempts). |
Lock Screen |
GravityBridge runs a Python web server on port 15842. It connects your phone browser to the ADB tool and the Antigravity local server:
βββββββββββββββββββββββ HTTP (Wi-Fi / Tailscale) ββββββββββββββββββββββββββββββββββββ
β Phone Browser β βββββββββββββββββββββββββββββββΊ β GravityBridge Proxy :15842 β
β (Chrome / Brave) β β β
βββββββββββββββββββββββ β βββββββββββββββββββββββββββββββ β
β β Tab 1: Antigravity AI Chat β β
β β Tab 2: Phone Drive Explorerβ β
β β Tab 3: OpenCode Web Editor β β
β ββββββββββββ¬βββββββββββ¬ββββββββ β
ββββββββββββββββββββββββββββββββββββ
β β
HTTPS localhost β β HTTP localhost
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β Antigravity β β OpenCode AI β
β IDE :65286 β β Server:14096 β
ββββββββββββββββ ββββββββββββββββ
- Proxy Server: It automatically finds the SSL port of the Antigravity desktop app on your laptop and forwards all chat traffic to it.
- Phone Drive API: It uses standard Android Debug Bridge (ADB) commands to communicate with your phone storage.
- Single Page Web App: Serves a fast dashboard page to switch between Chat and Phone Drive tabs quickly (less than 300ms).
Before this tool: You are relaxing on the couch. You think of a bug fix or want to see if your tests finished running. You have to get up, go to your desk, open your laptop, and type.
With this tool:
- Open Brave or Chrome on your phone and go to your laptop IP (
http://192.168.1.100:15842). - Log in with your PIN.
- Tap Chat to load your Antigravity 2.0 workspace.
- Type: "Run git status and tell me if the tests passed." The agent runs the shell commands and replies in real-time.
- If you need to upload a screenshot of a bug, tap Phone Drive, select the photo, and tap Pull to PC. Done.
| Feature | Standard Gemini Web/App | Antigravity 2.0 |
|---|---|---|
| System Control | β None (only sandboxed chat) | Direct file system access, run local terminal commands |
| Codebase Parsing | β Manual file uploads | Auto AST-based analysis of the whole folder |
| Automation | β Prompt and reply only | Run background tasks, timers, and cron schedules |
| Privacy & Hosting | β Sent to cloud servers | Runs 100% locally on your laptop |
| Feature | Antigravity 2.0 alone | Antigravity 2.0 + GravityBridge |
|---|---|---|
| Mobile Access | β Only works on your laptop screen | Accessible from any phone browser |
| Wireless Transfers | β Needs USB cable or cloud drives | Built-in ADB-over-Wi-Fi Phone Drive explorer |
| Lock Screen Auth | β None | Secure PIN login with rate-limiting protection |
| Feature | Description |
|---|---|
| Phone Drive Explorer | Browse phone /sdcard in real-time via ADB Wi-Fi |
| Checkbox Selection | Choose multiple files or folders before copying |
| Local Drop Zone | Drag and drop files or folders from laptop browser |
| ZIP Auto-Extract | Drop a .zip file on your laptop, and it extracts automatically |
| True Progress Tracking | Server-side progress bar reporting (bypasses VPN buffering) |
| Single-Item Retry | Retry individual failed transfers without re-uploading everything |
| Instant SPA Switching | Switch between Chat and Phone Drive tabs quickly (under 300ms) |
| Background Preload | Chat tab loads in background after login, so it opens instantly |
| Toast Alerts | Popups on phone screen when a new device connects to the server |
| PIN Security | Lock screen protects all pages and API routes |
| Brute Force CAPTCHA | Blocks an IP after 5 failed PIN attempts, captcha required to unlock |
| Requirement | Details |
|---|---|
| Python 3.10+ | Check version: python --version |
| Android Debug Bridge (ADB) | Download Platform Tools |
| Tailscale (optional) | Recommended for secure cross-network access: tailscale.com |
| Android Phone | Wireless Debugging enabled in Developer Options |
| Antigravity Desktop App | Running on the same laptop |
git clone https://github.com/Arora-Sir/Gravity-Bridge.git cd Gravity-Bridge
cp .env.example .env
Open .env in any text editor and fill in your values:
# Your secret passphrase for the lock screen AUTH_PIN=yourStrongPassphrase123 # Full path to your ADB executable (required for Phone Drive Explorer) ADB_EXECUTABLE_PATH=C:\platform-tools\adb.exe # Port the proxy listens on (optional, change if default conflicts) PROXY_PORT=15842 # Your display name (used in AI system prompts) USER_DISPLAY_NAME=YourName
GravityBridge automatically generates a gravitybridge.json file in your repository root on first run. You can edit it to toggle bottom tabs or configure auto-launch behavior:
{
"version": "2.0.0",
"tabs": {
"chat": true,
"drive": true,
"opencode": true
},
"opencode": {
"auto_start": true,
"open_pc_browser": true
}
}tabs: Set any tab (chat,drive,opencode) totrueorfalseto show/hide it on your bottom navigation bar.opencode.auto_start: Set totrueto automatically launchopencode serveonOPENCODE_PORT(default14096in.env). When set tofalse, GravityBridge automatically terminates any active OpenCode session running onOPENCODE_PORTfrom Task Manager.opencode.open_pc_browser: Set totrueto auto-open OpenCode (http://localhost:14096) in your laptop browser for live session mirroring.
Important
Antigravity 2.0 must already be running on your Windows laptop before this step. GravityBridge works by finding the Antigravity local server port and forwarding all chat traffic to it. Without Antigravity running, the Chat tab will not work.
python -u proxy.pyYou should see output similar to:
[+] AUTH_PIN loaded from .env (20 chars)
[+] PROXY_PORT set to: 15842
====================================================
GravityBridge 5.38: Dynamic HTTP Proxy
====================================================
[*] Searching for active port...
[+] Found active SSL port (200 OK): 65286
[+] Dynamic Routing Active -> Forwarding to https://127.0.0.1:65286
[+] Proxy listening on http://0.0.0.0:15842
====================================================
Make sure your phone is on the same Wi-Fi network, and find your laptop IP:
ipconfig | Select-String "IPv4"
Then open this URL in your phone browser:
http://YOUR_LAPTOP_IP:15842/upload
(Example: http://192.168.1.100:15842/upload)
Both devices must be connected to the same local router. Open the site using your laptop local IP (192.168.x.x).
- Install Tailscale on both laptop and phone: tailscale.com/download
- Sign in with the same account on both devices.
- Turn on Tailscale on your phone. Your laptop will appear with a private
100.x.x.xIP. - Open on your phone browser:
http://100.x.x.x:15842/upload(works over mobile data too).
Required for the Phone Drive Explorer to list files and pull storage.
- Go to Settings -> About Phone -> Software Info.
- Tap Build Number 7 times to unlock Developer Options.
- Go to Settings -> Developer Options -> Wireless Debugging and turn it on.
- Note your phone IP and port, and run on your laptop:
adb connect YOUR_PHONE_IP:5555
adb devicesExpected output:
connected to 192.168.1.200:5555
List of devices attached
192.168.1.200:5555 device
- Install Shizuku from the Play Store.
- Enable ADB via Shizuku (requires one-time USB setup).
- ADB will stay persistently authorized without requiring re-approval prompts on phone reboots.
GravityBridge supports a premium global skill for Google Antigravity that allows your AI coding assistant to wirelessly interact with your phone storage directly via chat commands.
Instead of browsing files manually, you can instruct the agent in plain language:
- "Pull my tax documents from my phone drive"
- "Search my phone for OpenCV notes and download them"
- "/sdcard status"
To register the skill and its rules globally for the Antigravity agent:
-
Locate the Global Customizations Root: On Windows, the default path is
C:\Users\<YourUsername>\.gemini\config\. -
Add the Skill: Create a directory named
skills\sdcardinside that path, and save the following content asSKILL.md:--- name: sdcard description: Automated wireless phone drive transfers via ADB, checking Tailscale connection status, and listing or pulling directories/files to AutomaticUploads. --- # Skill: Phone Drive Puller (`/sdcard` Command) This skill enables the AI assistant to interact with the user's Android phone storage (`/sdcard`) wirelessly using ADB over Tailscale or local Wi-Fi. ## Dynamic Path & Workspace Resolution To ensure compatibility across different directories and clones: 1. **Locate the Gravity-Bridge Root**: - Check if `scripts/sdcard_helper.py` exists in the active workspace root. If so, that is the Gravity-Bridge root path. - Otherwise, use the path of the Gravity-Bridge folder on your system (e.g., `C:/path/to/Gravity-Bridge`). 2. **Execute Commands**: - Always run the python command `python scripts/sdcard_helper.py <command> <args>` with the working directory (`Cwd`) set to the resolved Gravity-Bridge root path. 3. **Build Clickable Links**: - The helper script saves pulled items into the local folder `DeviceUploads/AutomaticUploads/` relative to the script location. - Dynamically construct the absolute clickable link using the format `file:///<resolved_gravity_bridge_root_path>/DeviceUploads/AutomaticUploads/<basename>`. ## Instant Connectivity Verification & Auto-Recovery Whenever a request is received, the agent must check connectivity status first and auto-recover any down dependencies instantly: 1. **Run Status Check**: - Execute `python scripts/sdcard_helper.py status`. 2. **Auto-Recover Laptop Tailscale**: - If `tailscale.laptop_active` is `false`: - Attempt to start the Tailscale client on the laptop (e.g. running `tailscale up` or booting `tailscale-ipn.exe`). - Notify the user: "Laptop Tailscale was offline; attempting to boot it now." - Re-run the status check. If it still fails, report the error and stop. 3. **Auto-Recover Proxy Server**: - If `proxy.running` is `false`: - Automatically start the proxy server in the background by executing `python proxy.py` under the resolved Gravity-Bridge root path. - Notify the user: "Local proxy.py was offline; auto-booting it in the background now." 4. **Instant Phone Tailscale Warning**: - If `tailscale.phone_connected` is `false` or `tailscale.phone_active` is `false`: - Instantly reply stating: "Error: Your phone is not connected to Tailscale. Please open Tailscale on your mobile and connect." - Stop execution immediately. ## Triggering This skill is triggered when: - The user uses the `/sdcard` slash command. - The user says "Pull `<query>` from my phone drive", "Transfer `<query>` from my phone", or similar commands. ## Subcommand Workflows ### 1. General Request: "Pull `<query>` from my phone drive" When a user requests to pull a file or folder: 1. Extract the search query from the user's request. 2. Run the status check and execute the recovery steps listed under "Instant Connectivity Verification & Auto-Recovery". 3. Run `python scripts/sdcard_helper.py search "<query>"` to locate matching paths. 4. If matching files are found, present them to the user in a checklist format. 5. **Mandatory Confirmation**: Ask the user: "Which of these files would you like me to transfer to your laptop? Please confirm (e.g. 'all', '1 and 2', 'yes')." 6. Once approved, run `python scripts/sdcard_helper.py pull "<selected_path>"` for each selected path. 7. Display success with a clickable link to each file in `DeviceUploads/AutomaticUploads/` dynamically constructed using the resolved root path.
-
Register the Global Rules: Open
AGENTS.mdin your global customizations folder (C:\Users\<YourUsername>\.gemini\config\AGENTS.md) and append:## π± Wireless Phone Drive (/sdcard Slash Command) Whenever the user references the `/sdcard` command or asks to pull/transfer files from their phone (e.g. "Pull <query> from my phone drive"): 1. The agent MUST trigger the `sdcard` skill. 2. The agent MUST check connectivity status using `python scripts/sdcard_helper.py status` under the resolved Gravity-Bridge root directory. 3. The agent MUST perform instant connectivity validation and auto-recovery: - If laptop Tailscale is inactive, the agent must immediately try to start it. - If the proxy is not running, the agent must automatically boot it in the background (`python proxy.py` under the resolved Gravity-Bridge root folder) without asking the user. - If the phone is not connected to Tailscale, the agent must warn the user instantly and stop the workflow immediately. 4. The agent MUST search for candidates using `python scripts/sdcard_helper.py search "<query>"`. 5. The agent MUST present the candidate paths, sizes, and types to the user in a clear checklist format (e.g. [ ] 1: path, [ ] 2: path). 6. The agent MUST ask the user to choose which items to pull and MUST NOT start the transfer until the user explicitly confirms their selection (e.g., "all", "1 and 3", "yes"). 7. The agent MUST pull the selected file(s)/folder(s) using `python scripts/sdcard_helper.py pull "<path>"` to save it to the local folder `DeviceUploads/AutomaticUploads/` relative to the helper script. 8. The agent MUST display a success message with a clickable file link dynamically built from the resolved Gravity-Bridge root path and the relative path of the file.
Once configured, the AI agent coordinates ADB actions dynamically:
sequenceDiagram
actor User
participant AI as Antigravity Agent
participant PC as Laptop (ADB Host)
participant Phone as Android Device
User->>AI: "Pull my tax report from my phone drive"
AI->>PC: Run sdcard_helper.py status
PC-->>AI: Connected
AI->>PC: Run sdcard_helper.py search "tax"
PC->>Phone: adb shell find /sdcard -name "*tax*"
Phone-->>PC: Found path: /sdcard/Documents/tax_2026.pdf
PC-->>AI: File details (Path, size)
AI-->>User: "I found '/sdcard/Documents/tax_2026.pdf' (1.2 MB). Should I transfer it?"
User->>AI: "Yes, go ahead"
AI->>PC: Run sdcard_helper.py pull "/sdcard/Documents/tax_2026.pdf"
PC->>Phone: adb pull
Phone-->>PC: File copied successfully
AI-->>User: "Transferred successfully! Link: [tax_2026.pdf](file:///...)"
Gravity-Bridge/
βββ proxy.py # Main proxy server (all logic in one file)
βββ server.py # AI agent backend server
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template (copy to .env)
βββ DeviceUploads/ # All transferred files land here (auto-created)
β βββ PhoneUploads/ # Default subfolder for phone transfers
βββ static/ # HTML and CSS assets (served by server.py)
βββ README.md
All configuration is handled via the .env file:
| Variable | Required | Description |
|---|---|---|
AUTH_PIN |
Yes | Passphrase for the web portal lock screen |
ADB_EXECUTABLE_PATH |
For Phone Drive | Full path to adb.exe (e.g. C:\platform-tools\adb.exe) |
PROXY_PORT |
No | Port the proxy listens on (default: 15842) |
OPENCODE_PORT |
No | Port for OpenCode server (default: 14096) |
USER_DISPLAY_NAME |
No | Name used in AI system prompts (defaults to Windows username) |
USER_HOME_PATH |
No | Home directory for file operations (defaults to ~) |
TAILSCALE_PHONE_NAME |
No | Device name of phone in Tailscale status (defaults to android) |
| Route | Method | Description |
|---|---|---|
/auth |
GET | Lock screen (PIN entry page) |
/auth |
POST | Validates PIN, issues session cookie, redirects to /upload |
/auth/sessions |
GET | Returns JSON list of active sessions |
/auth/logout |
POST | Log out of current session |
/auth/dashboard |
GET | Security dashboard showing sessions, blocked IPs, event log |
/upload |
GET | Serves the full Phone Drive portal HTML |
/upload |
POST | Receives file bytes, writes to DeviceUploads/ |
/upload-progress |
GET | Returns {received, total} bytes for true progress |
/adb-ls |
GET | Lists phone directory contents via ADB |
/adb-pull |
POST | Pulls a specific phone path to laptop via ADB |
/adb-pull-auto |
POST | Auto-searches phone for a folder by name and pulls it |
/ |
GET | Redirects to active Antigravity conversation |
Warning
GravityBridge exposes powerful local laptop capabilities (file writes, shell command execution, and debugger access). It is designed for private, local development. Never expose this port to the public internet, use a weak lock-screen PIN, or run the server on untrusted public Wi-Fi networks without active Tailscale WireGuard encryption.
- PIN Authentication: Lock screen protecting all critical pages and APIs.
- File Path Sanitization: Path inputs strip
..sequences to prevent directory traversal. - Brute Force Defense: Rate-limiting blocks an IP for 10 minutes after 5 failed PIN attempts, CAPTCHA required to unlock.
- Constant-Time Verification: Prevents timing side-channel attacks during PIN validation.
- Safe ZIP Extraction: Validates path bounds before extracting any ZIP entries.
To prevent anyone on your local physical Wi-Fi network from reaching the lock screen, query your Tailscale IP:
tailscale ip -4 # Example Output: 100.100.100.100
Then, update LISTEN_HOST in proxy.py:
LISTEN_HOST = "100.100.100.100" # Only reachable inside your Tailscale mesh
Ensure your Windows Firewall is allowing incoming traffic on the proxy port:
netsh advfirewall firewall add rule name="GravityBridge" dir=in action=allow protocol=TCP localport=15842
If the Phone Drive explorer reports an error connecting to the phone:
adb kill-server adb start-server adb connect YOUR_PHONE_IP:5555
To completely kill any hanging background proxy instances before starting:
Get-Process python | Stop-Process -Force python -u proxy.py
This project is licensed under the MIT License.
Copyright (c) 2026 Mohit Arora