on android 6.0.1 I am getting this error when trying to use run-as.
⋊> ~ adb shell 14:29:01 shell
@RustyX answer helped my partially. zlib didn't work in my Mac. So I had to use the Android Backup Extractor to convert .ab file to .tar file. You can download it here.
zlib
For the full step by step instruction, refer here.