title: Cannot build Phonegap project from command line
body: <p>I have built a Phonegap app and am now trying to integrate it with Phonegap Build. I'm following the very simple guide <a href="http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface" rel="nofollow">here</a>. </p>
  
  <p>So I am doing:</p>
  
  <pre><code>sudo npm install -g phonegap
  sudo phonegap create hello com.example.hello HelloWorld
  cd hello
  
  sudo phonegap local build android
  </code></pre>
  
  <p>The last command results in the error: </p>
  
  <pre><code>The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: /bin/sh: 1: android: not found
  </code></pre>
  
  <p>I then did:</p>
  
  <pre><code>which android
  </code></pre>
  
  <p>with the result:</p>
  
  <pre><code>/home/mark/Development/adt-bundle-linux-x86_64-20130522/sdk/tools/android
  </code></pre>
  
  <p>which is the corrent path. </p>
  
  <p>The phonegap version is 3.1.0-0.15.0.</p>
  
  <p>Any ideas why I am getting this error?</p>
  
  <p><strong>Edit</strong>
  If I run:</p>
  
  <pre><code>sudo phonegap local build /home/mark/Development/adt-bundle-linux-x86_64-20130522/sdk/tools/android 
  </code></pre>
  
  <p>I get yet another error:</p>
  
  <pre><code>/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:141
      platformPath = path.join('.', 'platforms', platform.local);
                                                         ^
  TypeError: Cannot read property 'local' of undefined
  at LocalBuildCommand.module.exports.addPlatform (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:141:60)
  at LocalBuildCommand.execute (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:95:32)
  at LocalBuildCommand.run (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:70:10)
  at Object.build (/usr/local/lib/node_modules/phonegap/lib/phonegap/util/command.js:28:25)
  at CLI.module.exports (/usr/local/lib/node_modules/phonegap/lib/cli/local.build.js:34:20)
  at CLI.module.exports [as argv] (/usr/local/lib/node_modules/phonegap/lib/cli/argv.js:66:17)
  at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/phonegap/bin/phonegap.js:24:21)
  at Module._compile (module.js:449:26)
  at Object.Module._extensions..js (module.js:467:10)
  at Module.load (module.js:349:32)
  </code></pre>