On Ubuntu 10.10 this scripts works only, if executed in bash.
I don't if there is any harm in changing from sh to bash, but if there isn't this will probably work better.
Change to bash to work on older Ubuntu versions
This looks like a legit patch.
At the moment, PhoneGap's source is built on top of Apache Cordova. Would you mind cloning the cordova-android source, making this patch, and sending a pull request to the Apache Cordova Android repository?
By getting the patch into Apache Cordova, PhoneGap will use it in the next release (2.2.0 in this case).
Thanks for your response. I submitted a pull request to the cordova android repository (https://github.com/apache/incubator-cordova-android/pull/47)