Publishing to Google Play
- We assume that you have already installed JDK, Gradle, Android Studio and other requirements specified here.
- Extract project to some folder, e.g.
MyApp
. So thatindex.html
will be in folderMyApp\Application
. - Open terminal/cmd and move to folder
MyApp
cd MyApp
- Create new cordova project using this command:
cordova create Android com.myapp MyApp
# Android is the folder name
# com.myapp - is reverse domain-style identifier of your application
# MyApp - application name.
- Open
Android
folder
cd Android
- Add android platform
cordova platform add android
- Now open file
MyApp\Application\config\index.js
and uncomment lines to build to Android folder:
module.exports = {
build: {
env: require('./prod.env'),
//index: path.resolve(__dirname, '../dist/index.html'),
//assetsRoot: path.resolve(__dirname, '../dist'),
index: path.resolve(__dirname, '../../Android/www/index.html'),
assetsRoot: path.resolve(__dirname, '../../Android/www'),
//index: path.resolve(__dirname, '../../IOS/www/index.html'),
//assetsRoot: path.resolve(__dirname, '../../IOS/www'),
...
},
- Open
Application
folder and install libs, if you haven't yet:
cd ..
cd Application
npm install
- Build project
npm run build
- Open Android folder and build cordova project
cd ..
cd Android
cordova build
- Now you can setup signing, icons etc. And finally connect devie and build your app for release:
cordova run android --release
- Then you can upload to Google Play signed app from
MyApp\Android\platforms\android\build\outputs\apk\
.
You can test published Vue Mobile default app in Google Play by the link.