5

I've downloaded the source for mips android and have done a "make" and got the emulator running. I want to push the busybox into the emulator. I've downloaded the static compiled busybox binary. Under which directory should I place this and what should I do to push the busybox into the emulator?

Sid Ramadoss
  • 521
  • 2
  • 6
  • 13
  • [Here](http://benno.id.au/blog/2007/11/14/android-busybox) you've got tutorial and binary for emulator. It worked for me. – pawelzieba Mar 17 '11 at 08:54
  • i was able to push it into the emulator and did a chmod 775. Then when I gave ./busybox --install, it throws an error which says "./busybox: 1: Syntax error: "(" unexpected". How do I resolve this? – Sid Ramadoss Mar 17 '11 at 10:06
  • I did the same and no errors. Emulator 2.2. Have you created correct directory structure? Try to run /data/busybox/busybox --install – pawelzieba Mar 17 '11 at 10:17
  • Yes I've created the directory structure correctly. The same error shows again. I have compiled the android sources with a cross compiler. And so used the same cross compiler for busybox code too. Does this have anything to do with the error? – Sid Ramadoss Mar 17 '11 at 11:40
  • I haven't compiled anything, just downloaded binary from the link I've provided and installed on emulator. – pawelzieba Mar 17 '11 at 11:46

2 Answers2

10
  1. Root your emulator
  2. Download this
  3. Extract it then move \system\lib\su and \system\app\superuser.apk to your adb directory.
  4. Run adb and then enter the following:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system  
adb push su /system/xbin/su  
adb shell chmod 06755 /system  
adb shell chmod 06755 /system/xbin/su
adb install superuser.apk
  1. Then download busybox from here
  2. Move it to your adb directory
  3. run adb and then enter:
adb shell mkdir /data/busybox
adb push busybox /data/busybox
adb shell
su
cd /data/busybox
chmod 775 busybox
./busybox --install
busybox
Community
  • 1
  • 1
Ahmed Hassan
  • 109
  • 1
  • 3
  • ./busybox --install installs files in various locations. I got No such file or directory, Invalid cross-device link errors. I wanted to install in /data/busybox folder. So, I used the following command: `./busybox --install .` – Sri Mar 09 '13 at 01:05
0

Updated instructions for 2023

Download busybox binary matching your AVD image architecture from https://github.com/meefik/busybox/tree/master/app/src/main/_libs. For example I downloaded the "arm64-v8a" directory to my desktop.

Execute the following commands (replace image name / device name with your own):

emulator -avd Pixel_6_API_31 -writable-system
adb -s emulator-5554 root
adb -s emulator-5554 remount
adb -s emulator-5554 push ~/Desktop/arm64-v8a/busybox /system/xbin/busybox

Now you can use busybox on your emulator:

adb -s emulator-5554 shell
emulator64_arm64:/ # busybox --help
BusyBox v1.34.1-meefik (2022-01-01 14:33:14 CST) multi-call binary.
...
Sebastian
  • 503
  • 5
  • 11