【发布时间】:2016-01-24 20:11:48
【问题描述】:
我已经植根了我的模拟器安卓设备,现在想要执行以下系统调用:
mount -o rw,remount /system
我的代码是:
Runtime.getRuntime().exec( "su -c mount -o rw,remount /system" );
但它不起作用。
谢谢
【问题讨论】:
我已经植根了我的模拟器安卓设备,现在想要执行以下系统调用:
mount -o rw,remount /system
我的代码是:
Runtime.getRuntime().exec( "su -c mount -o rw,remount /system" );
但它不起作用。
谢谢
【问题讨论】:
试试这个:
Runtime.getRuntime().exec( new String[]{"su", "-c", "mount -o remount,rw /system"} );
也试试这个:
Runtime.getRuntime().exec( new String[]{"su", "-c", "mount -o remount rw /system"} );
此外,您需要在 Android Manifest 中获得以下权限:
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
【讨论】: