Because the Toolbox provided by Android (in/system/bin) is too simple, some commands such as find do not support Android or are not well supported. Therefore, it is necessary to add the busybox tool to Android and compile a busybox tool that can be run in Android. We can use many common Linux commands, such as find and touch.
1. Download The busybox source code or obtain it from the SDK provided by the vendor.
2. Download the cross-compiler or use the SDK tool chain to ensure that it is consistent with the platform. Otherwise, the command execution fails due to different arch or version.
3. Start compilation and go to the busybox source code directory.
Run the make menuconfig command to configure the compilation process as follows:
Busybox settings-> build options->
[*] Build busybox as a static binary (no shared libs) should be selected, because the compiled busybox can be run independently.
(/Home/Jo/tool/arm-2008q3/bin/ARM-None-Linux-gnueabi-) Cross Compiler prefex this is the cross compiler's "path + prefix ", you must set it according to the actual situation.
Busybox settings-> Installation Options->
[*] The compiled busybox like don't use/usr won't be installed in the/usr directory of your host. Be sure to select.
If the header file cannot be found during compilation, you can specify the path of the header file used by the cross compiler and use the-I command.
Make install can be generated in the./_ install directory
4. Install busybox
Generally, place the commands in busybox in the out .... in the following system directory, note that many commands in busybox are soft links, so do not use the copy command of window, use the Linux CP-fr command, if it must be used in windows, package it in Linux before unpackage it.
As follows:
Lrwxrwxrwx 1 Root 7 05-25 13:59 time-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 timeout-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 top-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 touch-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 tr-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 traceroute-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 traceroute6-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 true-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 tty-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 ttysize-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 udpsvd-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 umount-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 uname-> busybox
Lrwxrwxrwx 1 Root 7 05-25 :59 uncompress-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 unexpand-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 uniq-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 unix2dos-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 unlzma-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 unlzop-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 unzip-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 uptime-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 usleep-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 udecode-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 uencode-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 vi-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 Vlock-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 volname-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 wall-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 watch-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 WC-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 wget-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 which-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 who-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 whoami-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 xargs-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 yes-> busybox
Lrwxrwxrwx 1 Root 7 05-25 13:59 zcat-> busybox
If this is not the case, it is wrong or the size of the large file is 0.
5. Use the modify/init. RC file to set environment variables.
Note that when you modify the PATH environment variable, put the path "/system/busybox/bin" of Common commands in busybox before the path "/system/bin" of Common commands in Android. Otherwise, the command for finding out will not be the busybox command. You can set it like this:
Export path/system/busybox/bin:/system/busybox/sbin:/system/bin:/system/xbin