How do I display message from from `adb shell` (or a shell script)? I expect it to be something like

adb shell am start SomethingArcane ... "Hello, world"


and the message box pops up on screen, saying "Hello, world".
Hacky workaround: DirectFB

With DirectFB and root access, you can display the text on screen directly, without Android at all.

I've implemented a program for this: directfbtext.

( echo "Hello, world"; echo "FLIP"; sleep 2; echo "QUIT" ) |  /h/bin/directfbtext --dfb:fbdev=/dev/graphics/fb0  --dfb:no-vt  /system/fonts/DroidSans-Bold.ttf 30 120 200 255


Note that it is probably not that easy to get DirectFB working on Android, but I happen to have it already configured.



Update Per user request, I've created and tested a "portable" pre-built version of directfbtext. Setting up and running:


Unpack directfbtext_deps.tar.gz into /data/local/tmp/;
Start adb shell, go root (su);
cd /data/local/tmp/directfbtext;
Create symlink from /usr/lib/arm-linux-gnueabi/ to /data/local/tmp/directfbtext:

# mount -o remount,rw / /
# mkdir /usr
# mkdir /usr/lib
# ln -s /data/local/tmp/directfbtext /usr/lib/arm-linux-gnueabi

Ensure display is on
LD_LIBRARY_PATH=. ./ld-linux.so.3 ./directfbtext --dfb:fbdev=/dev/graphics/fb0 --dfb:no-vt /system/fonts/DroidSans-Bold.ttf --dfb:system=fbdev 30 120 200 255
Type some text, followed by a line that reads "FLIP";
Observe the text visible on the display;
Type "QUIT" to exit directfbtext;
Interact with the device, so it updates display and clears remaining glitches caused by DirectFB.