如果在使用 Antigravity 时点击 "Sign in with Google" 没有反应或无法跳转,请按照以下步骤手动完成授权。
<username> 替换为您的实际 Windows 用户名):cd "C:\Users\<username>\AppData\Local\Programs\Antigravity"
.\Antigravity.exe --inspect=9229
11819):
[Auth] Localhost server listening on port 11819
# 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
Enter the port from the log:。11819)并回车。如果运行脚本后没有自动弹出浏览器,请在第二个 PowerShell 窗口中继续输入以下命令:
Write-Host $url
PowerShell 会打印出完整的长链接。请复制该链接手动粘贴到浏览器地址栏访问即可。
提示:此方法因使用系统默认浏览器进行验证,经测试在部分网络受限环境(如大陆白名单模式)下也能顺利通过,无需额外配置代理。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.