내 응용 프로그램에서 내 SD 카드에있는 네이티브 코드를 실행하려고합니다.Runtime.getRuntime(). exec ("cmd")
java.io.IOException: Error running exec(). Command: [shell, /system/bin/chmod, 0777, /storage/emulated/0/Android/data/com.example.andridutilproject/files/native] Working Directory: null Environment: null
어떤 제안을 어떻게이 문제를 해결하기 위해 :
File sdCard = getExternalFilesDir(null); // directory where native file is placed
String nativeFile = "nativeFile";
String cmd = "shell /system/bin/chmod 0777 " + sdCard.getAbsolutePath() + "/" + nativeFile;
Process proc = Runtime.getRuntime().exec(cmd);
그러나 곧 Runtime.getRuntime().exec(cmd)
으로 실행, 그것은 오류가 발생합니다?
'shell'실행 파일이 없습니다. 왜 너는 그것을 달구려고 노력하고 있니? –