title: On a jailbroken iPhone, how can I run commands as root?
body: <p>I want to login as a root using <code>system</code> call in Xcode. I try this code without success:</p>
  
  <pre><code>System("su");
  System("alpine");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>System("su root");
  System("alpine");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>System("su root alpine");
  </code></pre>
  
  <p>When I google it I came to know that this is done using <code>NSTask</code> or <code>NSPipe</code>.
  Can anybody tell me how it possible to run multiple <code>system</code> commands using <code>NSTask</code> and <code>NSPipe</code>?</p>
  
  <p>Please give me some hints about this or another method to do this. I am using this application on jailbroken iPhone.</p>
  
  <p>Some more details are <a href="http://www.ifans.com/forums/showthread.php?t=290555" rel="nofollow">here</a>.</p>