2013-08-16 55 views
0

如何创建在/ system中运行命令的应用程序。 我需要给出的命令是:udpxy -p 4022. 该命令将启动我在/ system中的程序。在/系统中执行命令的应用程序

我不知道哪些命令用于创建执行此命令的应用程序。

如果有人能帮助,我将非常感激。

回答

0
try { 

    Process process = Runtime.getRuntime().exec("/system/udpxy -p 4022"); 
    process.waitFor(); 

} catch (IOException e) { 

    throw new RuntimeException(e); 

} catch (InterruptedException e) { 

    throw new RuntimeException(e); 
} 

http://developer.android.com/reference/android/os/Process.html

+0

我会尽力谢谢你。 – user2656753

+0

在到达您发送的代码之前,应该在该行之后使用哪些代码?公共类MainActivity扩展活动{ – user2656753