Skip to content

Instantly share code, notes, and snippets.

@twiceyuan
Last active July 13, 2017 02:25
Show Gist options
  • Save twiceyuan/2f5485d93b17b5091de51ebf79379c63 to your computer and use it in GitHub Desktop.
Save twiceyuan/2f5485d93b17b5091de51ebf79379c63 to your computer and use it in GitHub Desktop.
[Android install busybox] Android 上安装 busybox #Android

先决条件

设备已经 root

步骤

  • 下载 busybox 二进制文件 https://busybox.net/downloads/binaries/ 唾手可得
  • adb push 到一个目录,比如 /data/local
  • adb shell,cd /data/local && ./busybox 看下是否正常,正常的话,现在使用 busybox vi 是可以使用 vi 编辑器了

之后的步骤就是使用 busybox 代替系统命令。

  • 首先需要重新挂载 system 目录为可读写
    • 查看 system 目录可使用 busybox df -h
    • 之后对对应的目录进行重新挂载:mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
  • 创建 xbin 文件夹(如果没有的情况下)
  • 拷贝 busybox 文件到 /system/xbin 下:cp /data/local/busybox /system/xbin
  • 安装:cd /system/xbin && busybox --install .
  • 重新挂载回只读:mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
  • sync 同步一下

就可以了,不可以的话重启一下。

参考资料:https://stackoverflow.com/questions/21900603/how-to-install-busybox-in-android-using-adb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment