Answer the question
In order to leave comments, you need to log in
How to run a system Android application?
This is the python code
import os
os.system("python")
Answer the question
In order to leave comments, you need to log in
There is a huge difference between running applications and shell commands.
For an application, you need to know the package.
Intent launchIntent = getPackageManager().getLaunchIntentForPackage(<пакет>);
if (launchIntent != null) { // null если приложение не найдено или не имеет активити для запуска.
startActivity(launchIntent);
}
try{
Process su = Runtime.getRuntime().exec("su");
DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());
outputStream.writeBytes("<команда>\n");
outputStream.flush();
outputStream.writeBytes("exit\n");
outputStream.flush();
su.waitFor();
}catch(IOException e){
throw new Exception(e);
}catch(InterruptedException e){
throw new Exception(e);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question