title: How to build and sign an apk file?
body: <p>I want create an APK file and sign it using PHP. I read many posts here for this and all of them suggested to install SDK on server and use <code>exec</code> or <code>shell_exec</code> to build the project.</p>
  
  <p>Well, that's pretty easy but how can I sign it using PHP? I use the <code>keytool</code> `command for signing APK, but while signing it asks me for many details like my key passphrase, my name, and my organization details. I don't know how to give this information when using PHP.</p>
  
  <p>For an instance:</p>
  
  <pre><code>###SHELL###
  $  keytool -genkey -v -keystore TestApp.keystore -alias TestApp -keyalg RSA -keysize 2048 -validity 10000
      Enter passphrase: my  passphrase here
      Repeat the passphrase: my passphrase again
      Enter your full name: my name
      Enter your organization unit: my org. unit
      Enter your organization name: my org. name
      Enter password for keystore (press return for same as key passphrase): i press enter here
  
     Success!!
  
  $ _  
  </code></pre>
  
  <p>How can I provide those details using PHP's <code>shell_exec</code> function?</p>