I searched some related questions in this forum. The most relevant Question is
I realized, that there is a function on Android also with
Runtime.getRuntime().exec( "su");
and now I want to realize the same function on iOS. In the process of realization. I need to get the root privilege. bucause some commands should run with root privilege.
I use the following method
system("ping 127.0.0.1");
All is ok. But when I change the route table with
system("route add -host 192.168.1.10 192.168.1.11");
I get the error. Because adding route item to the route table needs root privilege. I tried the following command
echo alpine | sudo -s route add -host 192.168.1.10 192.168.1.11
but there is no sudo command.
Thanks in advance for any useful pointers/suggestions/thoughts.