在 Termux 中拉起浏览器

使用 Termux API 拉起手机上的浏览器

技术#Termux

termux-open-url 启动

使用 termux-open-url 拉起系统默认浏览器。

# 安装 Termux API
pkg install termux-api
# 拉起浏览器打开指定页面
termux-open-url https://www.google.com

这也是推荐的打开方式。

am 命令启动

如果不想安装额外的 termux-api 包,也可以使用下面的命令:

am start -a android.intent.action.VIEW -d https://www.google.com

Termux 本质是 Android shell,可以直接调用 Android Activity Manager。

如果你想指定浏览器(比如 Chrome),可以用:

am start -n com.android.chrome/com.google.android.apps.chrome.Main -d https://www.google.com

安卓原生终端

安卓 16 版本已经内置了原生 Linux 终端,可以在开发者工具设置中打开,只是目前远不如 Termux 好用。

评论

0 条
内容

提交后会显示在评论区。

这里空空如也。

Nepsyn 的四叠半赛博空间Copyright © 2026 Nepsyn. All rights reserved.