petervojtek / cordova-plugin-shell-exec

Apache Cordova Plugin to Execute Commands in Smartphone's Operating System Shell
Apache License 2.0
34 stars 17 forks source link

Can't make it work with with most commands #8

Open hvdwolf opened 7 years ago

hvdwolf commented 7 years ago

Hi,

When I use a command like 'uptime' or 'pwd' or ['uptime'] or ['pwd'], it simply works. If I use something like 'tar' I expect the normal output on how to use it, but I see nothing. No output at all. Commands like 'ls -l' or ['ls -l'] or ['ls', '-l'] or 'mkdir -p /sdcard/tmp' or ['mkdir -p /sdcard/tmp'] or ['mkdir', '-p', '/sdcard/JT'] or ['sh', '-c', 'mkdir -p /sdcard/tmp'] simply don't work.

What is wrong or what I do wrong?

Edit: Even though it is a shell command doing "things" and not the apk itself, I also added the following 2 lines to my Androidmanifest.xml and recompiled, signed and zip-aligned. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

This didn't help either.

Poyser1911 commented 7 years ago

try https://github.com/Poyser1911/cordova-plugin-shell-exec used in a app i'm making all cmds a executed as root tho, used ls and mk -p in project as well all works and cmds joined up with &&.