This is a Cordova based project that wraps the Instabart code into a native app.
- Clone the app repository
git clone https://github.com/mortenvn/instabart-apps.git
-
Clone the main instabart repository. This is the same repo that is used at instabart.no 2.
cd instabart-apps3.git clone https://github.com/mortenvn/instabart.git www -
From the www folder, install grunt dependencies and generate production code 4.
cd www5.npm install6.npm install -g grunt-cli(might need sudo) 7.grunt phone -
Install the Cordova CLI, generate android and iOS projects and manually add custom app files 7.
npm install -g cordova(might need sudo) 8.cordova add platform android9.cordova add platform ios10. Manually copy files from the config folder into the correct platform folders (Example: config/android/AndroidManifest.xml -> platforms/android/AndroidManifest.xml)
- Test in emulator:
cordova emulate [android|ios] - Test using USB connected phone:
cordova run [android|ios]
As the main project evolves, the www files in the cordova project will have to be updated. Luckily, since we just cloned the project, getting the newest files is super easy.
From the www folder:
gruntgit pull origin mastergrunt phone
First time you want to create a production .apk, do the following steps. By doing this you will be able to generate a release version of the APK, sign it and zipalign it using just one command.
cd PROJECT_ROOT/platforms/androidtouch ant.properties- Open the newly created ant.properties and add the following lines:
key.store=/PATH/TO/KEYSTOREkey.alias=instabart
- Open
config.xmland increment the versionName and versionCode git add config.xml && git commit -m "Something smart"cordova build android --release
This will create a Instabart-release.apk file in the folder platforms/android/ant-build. We're done!
Coming to a markdown document near you soon.