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
cd instabart-apps
git clone https://github.com/mortenvn/instabart.git www
-
From the www folder, install grunt dependencies and generate production code
cd www
npm install
npm install -g grunt-cli
(might need sudo)grunt phone
-
Install the Cordova CLI, generate android and iOS projects and manually add custom app files
npm install -g cordova
(might need sudo)cordova add platform android
cordova add platform ios
- For Android, manually update
AndroidManifest.xml
with the correct minSDKVersion. As of now, the proper value is<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
-
Add Cordova plugins
cordova plugin add cordova-plugin-statusbar
cordova plugin add cordova-plugin-device
cordova plugin add cordova-plugin-inappbrowser
- 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:
grunt
git pull origin master
grunt phone
Run android sdk
and download the newest versions of Android.
Run the following commands in terminal:
sudo npm update -g cordova
cordova platform update android
cordova platform update ios
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.
!!!UTDATERT!!!
cd PROJECT_ROOT/platforms/android
touch ant.properties
- Open the newly created ant.properties and add the following lines:
key.store=/PATH/TO/KEYSTORE
key.alias=instabart
- Open
config.xml
and increment the versionName and versionCode git add config.xml && git commit -m "Something smart"
- Delete the
node_modules
folder from www. By doing this you reduce the app file size by approx. 20 MB. cordova build android --release
- Restore the
node_modules
folder
This will create a Instabart-release.apk file in the folder platforms/android/ant-build. We're done!
- Install dependencies
sudo npm install -g ios-deploy
andsudo npm install -g ios-sim
- Click on
Instabart.xcodeproj
to open the project in Xcode - Select "Team" under General -> Identity -> Team -> Morten V Noddeland (morten@noddeland.no)
- Set "Code Signing under Build settings -> Code Signing -> Release -> "iPhone Distribution: Morten V Noddeland"
- Open
config.xml
and increment the versionName and versionCode git add config.xml && git commit -m "Something smart"
- Delete the
node_modules
folder from www. By doing this you reduce the app file size by approx. 20 MB. - Open project in Xcode, then click Product -> Archive
- Restore the
node_modules
folder