V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
DAOCLOUD
推荐学习书目
Python Cookbook
Using Google App Engine
推荐下载
Latest Google App Engine SDK
其他兼容技术
AppScale
Michaol
V2EX  ›  Google App Engine

给还没能在 Windows 登录 Antigravity 的同学多一条路试试

  •  
  •   Michaol · 3 小时 19 分钟前 · 223 次点击

    解决 Antigravity Google 登录失败的详细指南

    如果在使用 Antigravity 时点击 "Sign in with Google" 没有反应或无法跳转,请按照以下步骤手动完成授权。

    步骤 1:启动 Antigravity 调试模式

    1. 打开第一个 PowerShell 窗口。
    2. 进入程序目录(请将 <username> 替换为您的实际 Windows 用户名):
      cd "C:\Users\<username>\AppData\Local\Programs\Antigravity"
      
    3. 使用调试端口启动程序:
      .\Antigravity.exe --inspect=9229
      
    4. 在弹出的 Antigravity 窗口中,点击 **"Sign in with Google"**。
      • 注意:只点击 1 次。每次点击都会随机生成新的监听端口。
    5. 回到 PowerShell 窗口,寻找类似以下的日志输出,并记下端口号(例如 11819):

      [Auth] Localhost server listening on port 11819

    步骤 2:生成授权链接

    1. 保持第一个窗口不动,打开 第二个 PowerShell 窗口。
    2. 复制并运行以下完整脚本:
    # 1. 输入端口号
    $port = Read-Host "Enter the port from the log"
    
    # 2. 设置回调地址
    $redirect = [uri]::EscapeDataString("http://localhost:$port/oauth-callback")
    
    # 3. 设置 Scope
    $scope = [uri]::EscapeDataString(
        "https://www.googleapis.com/auth/cloud-platform " +
        "https://www.googleapis.com/auth/userinfo.email " +
        "https://www.googleapis.com/auth/userinfo.profile " +
        "https://www.googleapis.com/auth/cclog " +
        "https://www.googleapis.com/auth/experimentsandconfigs"
    )
    
    # 4. 设置 Client ID
    $clientId = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com"
    
    # 5. 生成随机 State
    $state = [uri]::EscapeDataString([guid]::NewGuid().ToString())
    
    # 6. 拼接最终 URL
    $url = "https://accounts.google.com/o/oauth2/v2/auth" +
           "?client_id=$clientId" +
           "&redirect_uri=$redirect" +
           "&response_type=code" +
           "&scope=$scope" +
           "&access_type=offline" +
           "&prompt=consent" +
           "&state=$state"
    
    # 7. 尝试打开浏览器
    Write-Host "Opening browser..." -ForegroundColor Green
    Start-Process $url
    

    步骤 3:完成验证

    1. 脚本运行后会提示:Enter the port from the log:
    2. 输入步骤 1 中获取的端口号(例如 11819)并回车。
    3. 此时默认浏览器应自动弹出 Google 登录界面。
    4. 登录并点击允许,授权完成后浏览器通常会跳转或显示无法连接(这是正常的),此时 Antigravity 客户端应已成功登录。

    常见问题处理

    如果运行脚本后没有自动弹出浏览器,请在第二个 PowerShell 窗口中继续输入以下命令:

    Write-Host $url
    

    PowerShell 会打印出完整的长链接。请复制该链接手动粘贴到浏览器地址栏访问即可。

    提示:此方法因使用系统默认浏览器进行验证,经测试在部分网络受限环境(如大陆白名单模式)下也能顺利通过,无需额外配置代理。

    2 条回复
    111111111111
        1
    111111111111  
       3 小时 7 分钟前
    起始就只要做两件事:
    1. 一个可以访问 google 的浏览器(通过插件实现浏览器全局代理)
    2. 点击 Sign in with Google 之前 [断网] ,得到 URL 后然后用第一步的浏览器访问
    blufaux
        2
    blufaux  
       3 小时 5 分钟前
    楼上的有点 6
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1578 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 16:18 · PVG 00:18 · LAX 08:18 · JFK 11:18
    ♥ Do have faith in what you're doing.