Shell .profile or /etc/profile for old android 2.3.3
As I wrote in the other question, adb shell does not start a login shell. Only login shells read /etc/profile.

As you can see in Android 2.3.3 sh source, main.c lines 175ﬀ. only if argv[0] starts with a hyphen-minus is the shell considered a login shell. However, a few lines below (lines 185ﬀ.) there is code to read the content of $ENV.

So you could trick it and enter the following code after entering adb shell mode:

ENV=/etc/profile sh


You can probably use exec to replace the current shell, but this is the shortest to type I can come up with, as you will have to type it every time.



Alternatively, you can compile mksh for Android 2.3 (it works down to at least 1.5, if not older) manually (the Android.mk file is version-specific, unfortunately, so you’ll have to call Build.sh directly) and add the binary, then replace the default sh with it (I tested that first with Android 1.6; the newer the mksh version used the better, as early versions had bugs, e.g. preventing adb install from working).

Disclaimer: I’m the mksh developer.