How do I create an archive for easy extraction to /data/local/tmp/ in "adb shell"? Usual shar archives fail to extact in adb shell due to problems with lock directory and temporary files for HERE documents. Zip archives are also not an option.

How do I make an archive that can be easily extracted to /data/local/tmp/ out of the box on unrooted Android without busybox?
You can install busybox pretty easily on an unrooted Android phone.  Steps:


Grab the file busybox-android from the eponymous github project.
Get it onto your device via scp, adb push, Android File Transfer, etc.  Put it somewhere public that you'll have access to from a Terminal Emulator session.  Just call it busybox.
Start a Terminal Emulator session.  Make a directory ~/bin and copy the busybox file from the public place you put it to that new directory.

Since the cp command is not available in a Terminal Emulator session (!) do it this way: cat $PATH_TO_BUSYBOX/busybox &gt; ~/bin/busybox

Now cd ~/bin and create a symbolic link: ln -s busybox tar.


So now create a tarball using tar czv $FILENAME $ROOT_OF_FILES_TO_ARCHIVE, kick it over to your device, and extract using tar xzv $FILENAME.

tar is also available by default to ssh sessions served by SSHDroid (because SSHDroid provides busybox).  You might need to register it?  Don't remember if that stuff works on the free version.