Thanks to others members and some search, I've found the answers to the 2 questions:
(Big thanks to @Nate for this repply), it's possible to use NSTask in ios by importing the header file into the application project. The syntax is the same as the use in mac os x application but you can find some help here
An app placed into /Applications/ haven't the admin rights. For doing this, you have to:
1) In the main() function add setuid(0);
and setgid(0);
2) Build the app normally.
3) If you build an app named HelloWorld, Xcode will create a
HelloWorld.app directory, with a file named HelloWorld inside it, which
is executable. Rename this executable to, for example, MobileHelloWorld
4) Once you ve done that, create a new file in the HelloWorld.app
directory called HelloWorld
, and edit it with a text editor to give it
this content:
#!/bin/bash
dir=$(dirname "$0")
exec "${dir}"/MobileHelloWorld "$@"
That script will then be run when you tap the app's icon, because in the
app's Info.plist file, the name of the executable is
<key>CFBundleExecutable</key>
<string>HelloWorld</string>
and HelloWorld
is now a shell script, which invokes MobileHelloWorld
, the
renamed binary executable file.
5) In terminal, navigate to the app bundle.
6) chmod 0775
the original executable file and chmod 6775
the copied
executable file.
7) Copy the app bundle to /Applications
to a device. Restart SpringBoard
and you should be good to go. If the app doesn't launch then repeat step 5
& 6 on the device.
For this questions, all credits goes to (again :P) @Nate (here) and @JonasG (here)