Ionic 3 + Ion2 FullApp Template + built with rxJS style
-
git clone
-
npm i
-
dev mode:
-
in browser:
-
ionic serve
-
android:
-
connect device in data transfer mode
-
enable developer’s mode and USB debugging
-
ionic run android --device -l -c
-
open google chrome dev tools chrome://inspect, find the device/app, enjoy
-
ios
-
ionic run ios -l --device
-
connect device with data transfer cable
-
enable developers mode on device
-
open project in xCode
-
choose phone from dropdown, run project on your phone
-
you will see console logs in xCode (mention you might want to JSON.stringify all the data you show in console, cant stringify errors though)
-
production
-
ionic build ios --release
-
open in xcode
-
you might need to modify version in “General” tab and Camera and Library usage on “Info” tab
-
connect your ios device
-
Go Product -> Archive (if “Archive” is grey problem might be in the device which is not connected or with provisioning profiles and teams)
-
Open Window -> Organizer, you can see versions there (its important that every new version is higher then previous one)
-
Choose version, click “Upload” button on the right
-
Click “OK” and “Continue” etc. there might be an error while uploading, 2 things might help:
-
unchecking and checking the team profile on “General” tab
-
“restarting” the profile inside the popup window if “continue” button is grey
-
go to itunesconnect, testflight versions, it will ask you a question about the encryption, just choose no - app is published to testflight
-
to publish it into production go to production page, delete old version and choose new one, save
-
ionic android build --release (instructions can be also found here: http://ionicframework.com/docs/v1/guide/publishing.html)
-
sit in root of the application
-
keytool -genkey -v -keystore bt.keystore -alias bt -keyalg RSA -keysize 2048 -validity 10000 ← you do this only once. dont lose the password it will prompt you to create
-
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore bt.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk bt ./platforms/android/build/outputs/apk/android-release-unsigned.apk bt ← thats basically the address which ionic build
-
zipalign -v ./platforms/android/build/outputs/apk/android-release-unsigned.apk bt.apk
-
~/Library/Android/sdk/build-tools/VERSION_OF_YOUR_SDK_HERE/zipalign -v 4 ./platforms/android/build/outputs/apk/android-release-unsigned.apk bt.apk
-
grab bt-release.apk, go to android developer’s console, go into Versions and upload new one
Things to mention when building:
-
common/environment.ts holds connectivity info: API version and IP of a server
-
you might need to use ionic proxy to develop on devices with live reload or CORS plugin to develop in browser mode
-
if you want to develop on device with livereload, you will want to configure proxy. do so by adding this:
"proxies": [ { "path": "/API", "proxyUrl": "YOUR_SERVER_ADDRESS" } ],
into ionic-config.json. then you might want to configure the environment.ts file so that if "cordova" is detected (means livereload while you develop) it would go through proxy, otherwise (in browser) - straight to the server.
while developing in browser you probably want to use one of the CORS plugins to avoid issues