In "normal" android you start up a Terminal emulator or do "adb shell" and then from there you can defining a function by:

function name
name #runs "name"

But by using adb shell over TWRP it says the command "function" cannot be found. the command "whereis function" and "which function" provides no outputs and leaves me baffled. Any idea how to define function in TWRP, preferably over adb shell

  • 1
    TWRP does not feature a complete bash. It comes with a very minimalistic shell, but you are able to call a bash shell through TWRP AFAIK.
    – GiantTree
    Jul 14, 2015 at 21:30

1 Answer 1


When in recovery mount your /system using adb shell mount /system

though twrp can be twitchy otherwise use in-twrp mount function to mount system and you should have full room to do what you need. In recovery you have a functioning kernel, so after mounting your system you should have every thing at your disposal

adb shell mount /system
adb shell
~ # mount | grep system
/dev/block/platform/msm_sdcc.1/by-name/system on /system type ext4 (rw,seclabel,relatime,data=ordered)
~ # export PATH=/system/bin:/system/xbin:$PATH
~ # which busybox
~ # which sh

You must log in to answer this question.