给Android系统安装busybox
转自:http://blog.csdn.net/lxgwm2008/article/details/38925051
busybox号称Linux平台的瑞士军刀,它集成了100多个最常用的Linux命令和工具的软件。其中包含一些常用的工具,如ls,cat,echo等等;也包含了一些更强大,更复杂的工具,如grep,find,mount,telnet等等。这些工具在标准Linux系统上都有,但Android系统却去掉了其中的大部分工具,所以在调试和研究Android系统时有些不方便。为此,我们需要自己手动安装busybox。
1. 首先,拥有一台root过的Android手机。
2. 下载busybox。
下载地址:http://www.busybox.net/downloads/binaries/1.21.1/
(目前最新版是1.21.1)
打开网页后可以看到busybox支持了各种不同的arch,这里需要选择跟手机arch一致的版本。
我的手机是arm-v7,因此选择busybox-armv7l。
3. 安装busybox
将下载的busybox-armv7l改名为busybox,然后push到手机的/system目录下:
- adb push busybox /system
注:
a)如果遇到提示说没有权限,请先执行su
b)如果提示Read-only file system,则需要将/system目录重新挂在为可读写方式。具体可参考:http://blog.csdn.net/lxgwm2008/article/details/19044377
push成功后,开始安装busybox:
- chmod 755 busybox
- busybox --install
此命令将busybox默认安装到/usr/bin目录下。有些手机没有这个目录,比如我的Note 3,其目录是/system/bin,这是需要更改默认安装目录:
- busybox --install /system/bin
安装成功后,执行busybox命令,会有如下提示:
- shell@hlte:/ $ busybox
- busybox
- BusyBox v1.21.1 (2013-07-08 10:26:30 CDT) multi-call binary.
- BusyBox is copyrighted by many authors between 1998-2012.
- Licensed under GPLv2. See source distribution for detailed
- copyright notices.
- Usage: busybox [function [arguments]...]
- or: busybox --list[-full]
- or: busybox --install [-s] [DIR]
- or: function [arguments]...
- BusyBox is a multi-call binary that combines many common Unix
- utilities into a single executable. Most people will create a
- link to busybox for each function they wish to use and BusyBox
- will act like whatever it was invoked as.
- Currently defined functions:
- [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash,
- awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl,
- bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod,
- chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm,
- conspy, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
- deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff,
- dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap,
- dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake,
- expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat,
- fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk,
- fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty,
- grep, groups, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid,
- hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave,
- ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip,
- ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel,
- kbd_mode, kill, killall, killall5, klogd, last, less, linux32, linux64,
- linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread,
- losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lsof, lspci, lsusb, lzcat,
- lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg,
- microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix,
- mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more,
- mount, mountpoint, mpstat, mt, mv, nameif, nanddump, nandwrite,
- nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od,
- openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress,
- pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv,
- printf, ps, pscan, pstree, pwd, pwdx, raidautorun, rdate, rdev,
- readahead, readlink, readprofile, realpath, reboot, reformime,
- remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm,
- rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script,
- scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont,
- setkeycodes, setlogcons, setserial, setsid, setuidgid, sh, sha1sum,
- sha256sum, sha3sum, sha512sum, showkey, slattach, sleep, smemcap,
- softlimit, sort, split, start-stop-daemon, stat, strings, stty, su,
- sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl,
- syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp,
- tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true,
- tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand,
- uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, users, usleep,
- uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog,
- wc, wget, which, who, whoami, whois, xargs, xz, xzcat, yes, zcat, zcip
- shell@hlte:/ $
开始享受随心所欲的自由吧!