Compiles and runs on my android tablet. It can run on an android device in two says: using the impoverished installation supplied with Android or after first installing a full Linux distribution. (You can also compile it within termux. Then you can copy settings.termux64 to settings and use bash ./configure instead of ./configure in case sh points to dash. Install clang++ instead of g++ and follow the general README). ANDROIDS installation: Use the already installed /system/bin/linker and ANDROIDs libc. Ubuntu contained some androideabi packages, but the programs I compiled with them didn't run on my tablet. Those generated by toolchains contained in androids NDK did work. Download and install NDK from https://developer.android.com/ndk/downloads/index.html or install it as part of the Androids SDK. IN EARLIER VERSIONS OF ANDROID NDK you had to do this: Use ndk-bundle/build/tools/make_standalone_toolchain.py to make an installation for the Android platform you compile for. make_standalone_toolchain.py -h shows how to use it. Something like: make_standalone_toolchain.py --arch arm --api 17 --install-dir yourdir In yourdir/bin are then programs like arm-linux-androideabi-g++ Add yourdir/bin to your path I had to add CPPFLAGS=-D__ANDROID_API__=17 or CFLAGS=-D__ANDROID_API__=17 or CXXFLAGS=-D__ANDROID_API__=17 during compilation. If the compiler creates running programs, you can compile libncurses, libmagic (optional) and libre2 (optional). You can make the first two cross-compile by running CFLAGS=-D__ANDROID_API__=17 ./configure --host=arm-linux-androideabi --prefix=/data/local The last by editing Makefile. Throw headers in yourdir/sysroot/usr/include and libraries in yourdir/sysroot/usr/lib If you don't want to put the dynamic libraries on your tablet/phone, keep only the static (*.a) libraries in yourdir/sysroot/usr/lib so they are statically linked. IN THE CURRENT VERSION OF NDK you have to do this: After installing NDK you have one of more versions in for example /home/yourlogin/Android/Sdk/ndk with names like 21.3.6528147. Here in is a directory like /home/yourlogin/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/ In which you can find programs like aarch64-linux-android26-clang++ 26 stands for the ANDROID API for which to compile. add /home/yourlogin/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin to your path Decide for which api number (e.g. 26) you want to use, and do: ln -s aarch64-linux-android26-clang++ aarch64-linux-android-g++ ln -s aarch64-linux-android26-clang aarch64-linux-android-gcc And use aarch64-linux-android as the host name for cross compiling. e.g. say ./configure --host=aarch64-linux-android copy libncurses.a libre2.a ./libs from ncurses-/include copy term.h curses.h ncurses_dll.h unctrl.h to ./include file-/src copy magic.h to ./include cp -a /re2 ./include To stop bed from making a version using plugins change in ./config CONFIG_PLUGIN to CONFIG_PLUGIN=n Also configure bed with or change ./settings to add CPPFLAGS=-D__ANDROID_API__=17 CPPFLAGS=-D__ANDROID_API__=17 ./configure --host=arm-linux-androideabi --prefix=/data/local make dep;make make install DESTDIR=adir make an archive from the contend in adir and unpack it on your android device. adb can be used to login to your android device and transfer files. You can find it in ubuntu package adb or in platform-tools/adb of Androids SDK. First enable usb debugging mode: https://www.kingoapp.com/root-tutorials/how-to-enable-usb-debugging-mode-on-android.htm adb devices Will now recognise you device if you have connected it by USB adb shell Can make you login with adb push archivename /data/local/tmp you can upload the archive. If you have installed tar and gunzip you can install it with tar -zxf archivename -C / If you use root, this changes to rwx permissions and ownership of /data /data/local and /data/local/tmp to the values they have in the archive. The following values are maybe right: drwxrwx--x system system /data drwxr-x--x root root /data/local drwxrwx--x shell shell /data/local/tmp I could also use bed after booting in recovery mode. I have installed Team Win Recovery ( https://forum.xda-developers.com/galaxy-tab-10-1/development/recovery-twrp-3-0-x-t3522305). They use /sbin/linker instead of /system/bin/linker, so I used a binary editor to change /system/bin/linker into /sbin/linker in the bed binary (adding a 0 at the end in hex mode): 0000000 7F 45 4C 46 01 01 01 00 00 00 00 00 00 00 00 00 03 00 28 00 01 00 00 00 .ELF..............(..... 0000024 98 FD 00 00 34 00 00 00 F4 7C 8F 00 00 02 00 05 34 00 20 00 09 00 28 00 ....4....|......4. ...(. 0000048 26 00 25 00 06 00 00 00 34 00 00 00 34 00 00 00 34 00 00 00 20 01 00 00 &.%.....4...4...4... ... 0000072 20 01 00 00 04 00 00 00 04 00 00 00 03 00 00 00 54 01 00 00 54 01 00 00 ...............T...T... 0000096 54 01 00 00 13 00 00 00 13 00 00 00 04 00 00 00 01 00 00 00 01 00 00 00 T....................... 0000120 00 00 00 00 00 00 00 00 00 00 00 00 A0 E0 15 00 A0 E0 15 00 05 00 00 00 ........................ 0000144 00 10 00 00 01 00 00 00 A0 EA 15 00 A0 FA 15 00 A0 FA 15 00 1C 51 01 00 .....................Q.. 0000168 58 D3 01 00 06 00 00 00 00 10 00 00 02 00 00 00 2C 45 16 00 2C 55 16 00 X...............,E..,U.. 0000192 2C 55 16 00 10 01 00 00 10 01 00 00 06 00 00 00 04 00 00 00 04 00 00 00 ,U...................... 0000216 68 01 00 00 68 01 00 00 68 01 00 00 98 00 00 00 98 00 00 00 04 00 00 00 h...h...h............... 0000240 04 00 00 00 51 E5 74 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....Q.td................ 0000264 00 00 00 00 06 00 00 00 10 00 00 00 01 00 00 70 A0 DB 13 00 A0 DB 13 00 ...............p........ 0000288 A0 DB 13 00 58 52 00 00 58 52 00 00 04 00 00 00 04 00 00 00 52 E5 74 64 ....XR..XR..........R.td 0000312 A0 EA 15 00 A0 FA 15 00 A0 FA 15 00 60 65 00 00 60 65 00 00 06 00 00 00 ............`e..`e...... 0000336 08 00 00 00 2F 73 62 69 6E 2F 6C 69 6E 6B 65 72 00 69 6E 6B 65 72 00 00 ..../sbin/linker.inker.. 0000360 08 00 00 00 84 00 00 00 01 00 00 00 41 6E 64 72 6F 69 64 00 11 00 00 00 ............Android..... 0000384 72 31 36 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r16b.................... You can also use sed: sed 's/system\/bin\/linker/sbin\/linker\x0\x0\x0\x0\x0\x0/' < bed >newbed I also had to set some environmental variables: export TERM=rxvt export TERMINFO=/extra/data/local/share/bed/terminfo export BEDRC=/extra/data/local/share/bed/bedrc export LINES=52 export COLUMNS=177 AFTER FULL LINUX DISTRIBUTION INSTALLATION: Android builds upon a Linux kernel, but includes very few of the programs normally included in a Linux distribution. You can install a full Linux distribution under androids Linux kernel. Linux deploy automatises the installation: https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy After that you can just use apt to install programming tools needed for the compilation. See README. Then you can run bed on all kinds of terminal, which all have their specific problems with making the keys used by bed function. Terminal Emulator for Android (https://play.google.com/store/apps/details?id=jackpal.androidterm): In preferences “Alt key sends ESC” should be set. You can also use all kinds of xterm variants under X windows. Any program connected to XServer XSDL 1.11.40 or https://sourceforge.net/projects/libsdl-android/files/apk/XServer-XSDL/ViewTouch-1.11.40.apk has the following problem: Alt-e,Alt-i and Alt-N don't work. You can use Esc,e etc instead (type fast). It is also possible to use an android VNC viewer to display X programs (including x terminals): bVNC Free, DesktopVNC and Jump worked on my computer. When for some reason you tablet doesn’t start android, it is still possible to edit the tablets internal Flash memory with bed, if you can boot into recovery and connect over USB using the android debugger (adb). You first need to install twrp to add a new recovery Linux kernel and programs. You boot into recovery and connect the tablet to a computer's USB. On a computer terminal you type set|grep TERM # to get the term value of your TERMINAL adb devices # to see if your tablet is recognized adb shell export TERM=VALUEYOUFOUND # If that's no good try something else, for example rxvt When using adb export LINES= export COLUMNS= To install bed in /data/local/tmp/nontmp and also run it from termux without root, you need to change selinux context on the nontmp directory tree: /system/bin/chcon -R u:object_r:app_data_file:s0:c179,c257,c512,c768 /data/local/tmp/nontmp u:object_r:app_data_file:s0:c179,c257,c512,c768 should be the same what you see when doing /system/bin/ls -Z on termux files Because you have only executable permission in /data/local/tmp/nontmp, you should move the configuration files to /sdcard cp bedrc to /sdcard/.bedrc and set the path in .bedrc to the configuration directories in /sdcard This is all possible without root in adb shelll