Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12322

How to execute linux command in android programmatically?

$
0
0

As in android(through android sdk/tools folder) from command line we can execute linux shell command to access mnt folder/data folder likewise. (e.g cd data ls) now that command i want to execute from programmatically in android so how could it be possible?


I am using following code to execute shell command
Process p = Runtime.getRuntime().exec("cd data");

but it is giving me exception

java.io.IOException: Error running exec(). Command: [cd, data] Working Directory:  null Environment: null


so how should i proceed for it.Thanks in advance.

Viewing all articles
Browse latest Browse all 12322

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>