Go to your project root and open config.xml file in your text editor.
The first thing to change is your app's human readable name. Replace the name inside <name> </name>
.
Second, change the id value inside
<widget id="com.ionicframework.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
to your reverse domain name. For example, id="com.thirtypointdesign.app"
. This is important. The id is the unique identifier when you publish your app on iOS or Android. In iOS, this will be your bundle ID. In Android, this will be your package name.
Third, if you are updating your app. Please change your version number to a higher value. If this is your first time publishing the app, you do not need to change that.
If you want your app only in portrait mode, you can add this line in the xml file as well:
<preference name="orientation" value="portrait" />
For more customization information, please visit Cordova Official Site
You will need to build a digitally signed Android release APK file to distribute your app on Google Play Store or other app distribution channels. Note: You will need to pre-install Android SDK before moving to this step.
- Create your digital signed key (if you don't already have one).
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
- Add the Android Android platform.
ionic cordova platform add android
- Build a production / release version of your app. This will generate an android-release-unsigned.apk file under platforms/android/build/outputs/apk.
ionic cordova build android --prod --release
- Sign your release build apk.
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore android-release-unsigned.apk alias_name
- Align your build with the android zipalign tool. If you get a "command not found error", navigate to your android sdk folder, find the zipalign tool under build-tools / version number and drag the folder into your terminal to get the absolute path
[Your Android SDK path]/build-tools/[Newest version number]/zipalign -v 4 android-release-unsigned.apk [app-name].apk
/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/27.0.3/zipalign -v 4
The newly made apk is the final signed apk file you need to upload onto Google Play Store or any other Android distribution networks.
Now that you have your release APK ready for Google Play, you can create a Play Store listing and upload your APK. To start, you'll need to visit the Google Play Store Developer Console and create a new developer account. It will cost $25.
Once you have a developer account, you can go ahead and click "Publish an Android App on Google Play" and follow the on-screen instructions.
First, you'll need an Apple Developer account, They cost $99 /year. Once you're an Apple Developer, sign into the Apple Member Center and create an App ID (must match the one in config.xml), Certificate, and a Provisioning Profile. Once you have those in place:
- Add the iOS platform.
ionic cordova platform add ios
- Open the generated Xcode file and set your development team from the dropdown.
- Build a production version of your app.
ionic cordova build ios --prod
- If you now have a .xcarchive file in platforms/ios, open it in Xcode and skip to the very bottom. Otherwise continue to the next point.
- In Xcode, go to
Product > Archive
and archive your app for release. If you get a "check dependencies" error:
- uncheck / disable automatic signing
- re-check / enable automatic signing
- run
Product > Archive
again
Click "Submit to App Store" to submit your app. Note: In order to submit your app, you'll need to create it from iTunes Connect.
I see that this Ionic Publishing uses Cordova, but it is deprecated by Microsoft:
"In April 2022, Microsoft App Center deprecated Cordova support, a true sign of the waning popularity of the framework".
Do you think the guide should be changed to use something else?
Source of the statement:
https://ionic.io/blog/signs-its-time-to-migrate-your-cordova-app
Guide to migrate from Cordova to Capacitor, if needed:
https://capacitorjs.com/docs/cordova/migrating-from-cordova-to-capacitor