Http://www.cnblogs.com/xiaowenji/archive/2011/03/12/1982309.html
Have you ever had this experience, enter the ADB shell at the command line, and then use the command to manipulate your phone or simulator, but those commands are a shrinking version of the common Linux commands, which is very uncomfortable to use. Ever thought about using a more complete shell on Android? Use BusyBox. Whether using the ADB connection device using the command line or directly on the phone with terminal emulator is OK.
First, what is BusyBox?
BusyBox is a single executable implementation of standard Linux tools. BusyBox contains a few simple tools, such as Cat and Echo, and includes larger, more complex tools such as grep, find, Mount, and Telnet. Some people refer to BusyBox as the Swiss Army knife in the Linux tool. Simply speaking, BusyBox is like a big toolbox, which integrates many of the tools and commands of Linux. (Excerpt from Baidu Encyclopedia)
Second, install BusyBox on Android
Get ready:
0. First to the phone to root, the specific tutorial here is not provided, there are many online.
1. Download BusyBox binary, open this address http://www.busybox.net/downloads/binaries, select the latest version, then download the version corresponding to your device architecture, here I downloaded the busybox-armv6l , the following is an example of this file name.
2. Need to have a command-line environment, use ADB on your computer or use terminal emulator on your phone.
3. Connect the phone and the computer, the USB mode of the phone is set to none (charging only), and turn on the USB debug mode.
Installation:
1. Rename the busybox-armv6l to BusyBox
2. Put the busybox into the SD card of the phone, you can use the following command or you want to other methods.
Open Terminal (LINUX,MAC) or cmd (Windows)
adb push ~/Desktop/busybox /mnt/sdcard |
~/desktop Please replace the correct path according to your own situation.
3. Enter the following command in order to write files in the/system directory
adb shell su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 / system |
Use LS to check if there is a xbin directory in the/system, no input mkdir xbin created, because this example is to install BusyBox to/system/xbin.
4. Copy the BusyBox file to/system/xbin and assign it the "executable" permission
cp /mnt/sdcard/busybox / system /xbin chmod 755 busybox |
5. You can then use the BusyBox command, such as the clear command without a clear screen before, now just enter busybox clear to achieve the clear screen function, using the full version of LS only input busybox ls.
But it's too much trouble to add a busybox to the front, so we're going to finish the installation.
Enter under/system/xbin
If you want to install to a different directory, replace the point with a different path.
Now the installation is complete, compare the original LS command and the LS command in BusyBox.
Common errors:
1. If such an error occurs during installation,
BusyBox:/bin/zcat:no such file or directory
BusyBox:/sbin/zcip:invalid cross-device Link
Description did not enter the installation path, the correct example BusyBox--install/system/xbin
2. If such an error occurs,
CP:/system/xbin/busybox:read-only File system
Describes the mount command that did not correctly enter the third step above.
Tips:
1. BusyBox has ash and hush and sh these shells, in the command line input ash or hush, you can like in bash, by pressing the up and down keys to select the command just entered.
2. The Android system itself has the LS command, BusyBox also has LS, the input LS is called the Android LS, then want to use BusyBox ls to each time in the front add a busybox? No, it can be done using the alias command.
Similarly, CP, MV and so on both commands can be done this way. can also be resolved by modifying the/init.rc.
Install busybox--full bash Shell "turn" for Android