With updated termux-api we can get quite a speed increase by using termux-am-socket instead of termux-am.