惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
G
Google Developers Blog
V
V2EX
The Register - Security
The Register - Security
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
S
SegmentFault 最新的问题
博客园 - Franky
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
C
Check Point Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
F
Fortinet All Blogs
Jina AI
Jina AI
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
B
Blog
L
LangChain Blog
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
GbyAI
GbyAI

MoonLab

VSCode + OpenOCD 远程调试开发STM32 Clangd + VSCode使用方法 Keil5 编译错误 error: call to undeclared function '__enable_irq' BTSNOOP is FUN! 算法 - 前缀和 2025蓝桥杯赛后总结 三星ZFold 3改造 JavaScript 逆向 Steam 登录二维码 快速求解平方根倒数算法 Protobuf [双系统] Windows 更新摧毁了我的Linux系统 Reading List Golang embed 使用问题 Hexo博客自动备份插件 云盘备份支持 通过汇编分析栈、函数调用 esp&ebp Git push 出现 permisson denied error 403 坑:Litepal save方法返回true却没有保存 Android Shizuku源码分析 第二篇 Android Shizuku源码分析 Android 监听第三方Activity的一举一动 Android笔记#1 View的事件分发机制解析 知乎日报的问题 使用Hexo Hello World Ubnutu 无法启动网易云音乐 - 总结 Windows 好软推荐 | 这一定是良心软件 typecho - http转https 如何评价Android P MoonLab MoonLab MoonLab 关于 项目
Android设备安装Debian成为BT下载服务器
LingC · 2024-08-07 · via MoonLab

📦 由AI生成的摘要
文章介绍了如何在Android设备上通过Termux安装Debian,并配置VNC以便远程访问。作者提到,由于Android 12引入的Phantom Process Killer机制,Termux容易被杀死,因此提供了关闭该限制的ADB命令。接着,文章详细说明了如何安装XFCE桌面环境和配置VNC服务器,包括使用TightVNC的步骤。最后,作者提到可以进一步安装gogs作为本地Git服务器。

讲道理,我还从来没关注过VNC这个东西。早在几年前就知道了VNC,但其实我一直都用不上。

最近,我的Android设备因为电池寿命问题已经终止使用了,我就打算让他成为一个永久的·被插入的状态(指充电)。

为了方便,我直接用傻瓜脚本在Termux中装上Debian。

一键安装Debian脚本:https://github.com/wahasa/Debian

一键安装Ubuntu脚本:https://github.com/MFDGaming/ubuntu-in-termux

不过我不推荐在termux用ubuntu。因为Termux无法使用systemd,所以在ubuntu的snapd也就用不了。(但是如果root后似乎是有办法的。)而Ubuntu深度绑定了snap,就算有办法移除snap也挺麻烦的。snap对arm64处理器的优化也很少,为什么不直接用debian呢。

就比如在Ubuntu要通过传统的deb去安装firefox浏览器,就先需要用snap remove firefox来先删除,但是……snap是完全用不了的。

Phantom Process Killer

自Android12开始有一个Phantom Process Killer机制,会限制应用后台的子进程数量。所以Termux很容易被杀,从而出现Process completed (signal 9) 。 我用的是adb命令去关闭这项限制。

ADB工具下载链接:https://developer.android.com/studio/releases/platform-tools

adb devices

adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent"
adb shell "/system/bin/device_config put activity_manager max_phantom_processes 2147483647"
adb shell settings put global settings_enable_monitor_phantom_procs false

还有一种方法是在开发者设置中找到Feature flag,在里面关闭settings_enable_monitor_phantom_procs。不过不知道为什么,我的手机中的feature flag里什么都没有。

桌面环境 & VNC

为了让VNC客户端能够连接到手机中的Debian,要先装一个桌面。

我用的是xfce,可以直接用apt安装:

sudo apt install xfce4 xfce4-goodies

但是也可以用@wahasa的脚本,顺带就安装了tigervnc,而且配置好了/.vnc/xstartup

apt install wget -y ; wget https://raw.githubusercontent.com/wahasa/Debian/main/Desktop/de-xfce.sh ; chmod +x de-xfce.sh ; ./de-xfce.sh

这里我使用使用vnc-start去启动VNC Server只能监听本地的端口,在局域网内是搜不到的。

所以我添加了一个no localhost的flag:

$ vncserver -localhost no

TightVNC

如果要使用TightVNC

$ apt install tightvncserver

删除Server:vncserver -kill :1

修改VNC连接密码:vncpasswd

然后修改下~/.vnc/xstartup

#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

screenshot

更多

后续还可以安装gogs作为本地的git服务器。


Refs

https://docs.andronix.app/android-12/andronix-on-android-12-and-beyond