android - java.io.IOException: Error running exec(). Commands: [cd, sdcard/.yasmin] Working Directory: null Environment: null -
i try access folder in sdcard , install myapp.apk, use code:
runtime.getruntime().exec("cd sdcard/.yasmin"); runtime.getruntime().exec("adb install tefli.apk");
but unfortunatelly have error:
05-11 11:09:57.925: warn/system.err(1399): java.io.ioexception: error running exec(). commands: [cd, sdcard/.yasmin] working directory: null environment: null
anybody please have idea. in advance.
i not sure fix problem, afaik, each call exec()
creates new shell. possible solution following:
- get process of exec() using:
process p = runtime.getruntime().exec(...)
. - grab process inputstream using
p.getinputstream();
. - run second command.
also note trying access sdcard in root folder , in hardcoded path, consider following:
process p = runtime.getruntime().exec("cd /sdcard/.yasmin");
or better:
process p = runtime.getruntime().exec("cd " + environment.getexternalstoragedirectory() + "/.yasmin");
hope it'll help!
Comments
Post a Comment