I guess that means for development I’ll need to install this plugin and specify “Master” as the channel name. Once I want to publish the app to the app store, I’ll need to remove this plugin and install it with “Production” as the channel name.
Is there any easier way to switch between these two channels, without uninstalling and reinstalling the plugin?
Side question: does Live Deploy update native resources? For example, app icons, splash screens, android’s res folder, etc.
Hi guys, and anybody that lands here after a Google search.
After some research I think I figured out a good way to do it : using git branches.
As you may know, the default git branch is “master”. When you do git push ionic master you effectively send master to Ionic Pro.
You could create a second branch, let’s call it “production”, which contains all the modifications needed for a production app, be it your API endpoint or in this case the Deploy configuration.
I strongly encourage you to read about git branching but if you’re lazy here is the tl;dr:
git checkout -b production
cordova plugin add cordova-plugin-ionic --save \
--variable APP_ID="XXXXXXXX" \
--variable CHANNEL_NAME="Production" \
--variable UPDATE_METHOD="background"
git add -p
git commit -m "Create production branch with Deploy production channel"
git push ionic production
git checkout master
# Continue working on master as normal
# When you are ready for production you can switch back and merge all your changes to production :
git checkout production
git merge --no-ff master
# note : rebase is probably safer, in particular if you committed changes to the lines that need to be different in prod
git push ionic production
git checkout master
# Repeat
Definitely, using version control is the best option. But it is not necessary to reinstall the plugin in each branch. Just make the parameter changes in the files “package.json” and “config.xml”