[Android] installs busybox--full bash shell for Android (favorites)

Source: Internet
Author: User

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 shellsumount -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/xbinchmod755 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

busybox --install .

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.

alias ls=‘busybox ls‘

Similarly, the CP, MV, and so on both commands can be done. can also be resolved by modifying the/init.rc.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.