Android Execute External .sh - Max Number of Commands?
<p>I'm calling a natively compiled executable via my Android application.</p>

<p>I need to call it multiple times, and to make sure the commands are executed sequentially I append them all to a script and then call this via /system/bin/sh. </p>

<pre><code>Runtime.getRuntime ().exec ("/system/bin/sh /path/to/script.sh"); 
</code></pre>

<p>All fine. </p>

<p>However, in certain situations I need to run quite a large number of commands. I'm noticing that there is an upper limit to the amount of commands in the .sh that will actually get executed. </p>

<p>Is there a max processes limit barrier I am hitting? I would expect executing them sequentially should keep this number low, i.e. run them in series. </p>

<p>The reason I think I'm hitting some kind of limit is that it never makes it past a certain number of commands around 20. (I have checked the actual command syntax and it is fine). I also get no output from the Process object when this mysterious limit is reached. </p>

<p>I'm kind of stumped as to why this is happening, and can't find any information on how to proceed. Any ideas? </p>

<p>Thanks </p>
