Created
August 12, 2015 04:18
-
-
Save elct9620/c7eae8a7d789be468611 to your computer and use it in GitHub Desktop.
Auto generate cordova project and build using android sdk (Empty app)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File System | |
var fs = require('fs') | |
// Cordova Lib | |
var cordovaLib = require('cordova-lib'), | |
CordovaError = cordovaLib.CordovaError, | |
cordova = cordovaLib.cordova, | |
events = cordovaLib.events; | |
var opts = { | |
platforms: 'android', | |
verbose: true, | |
options: [] | |
} | |
cordova.raw.create( | |
'./app', | |
'tw.gwao.demo', | |
'Demo APP', | |
{} | |
).done(function() { | |
process.chdir('./app') | |
fs.writeFile('./www/index.html', process.env.APP_NAME || "Cordova", function(err) { | |
if(err) { | |
return console.log(err) | |
} | |
installApp() | |
}) | |
}) | |
function installApp() { | |
cordova.raw.platform('add', 'android', null).done(function() { | |
cordova.raw.run() | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment