Coder Social home page Coder Social logo

cordova-plugin-shell-exec's People

Contributors

cs8425 avatar jonongjs avatar petervojtek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-plugin-shell-exec's Issues

react-native module

Hi,

Would it be possible to also add a react native module wrapper for this code, so shell commands can be called from there?

How can I list folders and files ?

I've just started using the plugin and tried something basic:

window.ShellExec.exec('ls /storage', function(res){
          console.log('exit status: ' + res.exitStatus)
          console.log('cmd output: ' + res.output)
        })

but I get an IO error:

 java.io.IOException: Error running exec(). Command: [ls /storage] Working Directory: null Environment: null

I've added these permissions in platforms/android/AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

but I'm not sure what else I need to setup run the above command.
(The device I'm currently using is not rooted)

Any tips on how I should get past this error ?

Thank you,
George

Exec shell script?

Hi,
This plugin sound very interesting.
Can it run a shell script inside the app?

Some operations are easy to do with a shell script but complex in JavaScript.

The idea is to write part of app using sh or bash, and the rest in html5.

There is an example ?

Regards
MaX

Can't make it work with with most commands

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.

Read de external Storage sdcard

Hi

I'm tring to read (and then write) the sdcard using:

    <script>
    function lsfuncion() {
        window.ShellExec.exec('ls /sdcard/', function(res){
          console.log('exit status: ' + res.exitStatus)
          console.log('cmd output: ' + res.output)
//          alert(res.output)
            var div = document.getElementById("COMMAND");
            div.textContent = res.output;
            var text = div.textContent;
        })
    }    
    </script>
<div id="wrapper">
<p><a href="#" class="btn" onclick="lsfuncion();">$ ls /sdcard</a></p>
</div>  
<div id="COMMAND"></div>

but the result is: "Process has not yet termintated: 3577"
...that sound like the plugin can not read an external device mounted in the filesystem.

no problem if we try to read de root /

Can have a look for it, please?

Start APK using this plugin

Can the plugin be used to start an external APK, or it can only run OS commands ?
Thanks for any info.
Mario

Install from NPM

It seem that the package is on npm like other plugins so you shoud be able to use:

cordova plugin add cordova-plugin-shell-exec

it's shorter and you probably can change version, so why don't put this into README

Need to install node js (apt-get install nodejs)

HI,
I had run 'apt-get install nodejs ' from this plugin. I got status code =100 and out put is empty. But node is not installed in mobile. But i run this command through terminal ,Nodejs installed successfully . Kindly help for this issue asap

Command runs with adb but doesn't work with this plugin

I am running this command from my computer

$ adb shell input keyboard 26

and it's working perfectly ( turning the phone off ).
but when I try to execute this command using the plugin :

$ input keyboard 26

it doesn't work.

Thank you in Advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.