简体   繁体   中英

Difference of Ionic Cordova vs Cordova commands

I have been confused about the difference of building an apk using this commands:

ionic cordova build android

vs

cordova build android.

it seems that it has different output or file size when I look into debug apk on path

/platform/android/app/build/outputs/apk

Cordova have own libraries so far and it is stable ionics also use them.

https://cordova.apache.org/docs/en/latest/ Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies - HTML5, CSS3, and JavaScript for cross-platform development. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's capabilities such as sensors, data, network status, etc.

ionic also using that libraries for there frameworks and developments so in that case

best approach is why ionic use Cordova

Ionic, Cordova and PhoneGap are hybrid apps. ... They are written in JavaScript but are rendered using native components, which means that the user experience will generally be closer to other native apps, because they will conform to the standards imposed by the operating system

https://www.netguru.com/blog/why-you-should-migrate-your-app-from-ionic-cordova-or-phonegap-to-react-native

Ionic ships with many built-in components, that in most cases gives a UX/UI closer to native components. This is the basic advantage of using ionic.

The fact is, Ionic is built on top of Cordova, so you cannot argue that ionic runs better than Cordova itself. Ionic is like steroids that you can give to your Cordova apps.

在此输入图像描述

CLI

It is always best advised to use Ionic CLI commands over Cordova when in an ionic environment. This is to ensure that ionic properly packs all its components/files alongside with Cordova and your app logic.

Output Size

APK/IPA sizes vary depending on the amount of logic included, let alone the code from your specific framework. If a simple Cordova app is 4mb, then ionic would be 4mb + size of ionic components. Frameworks like Angular has complex engines like Ivy , that reduces the app build size, but those do not refactor anything related to Ionic or Cordova.

ionic cordova build android is Like running cordova build directly, but also builds web assets with configuration from ionic build and provides friendly checks.

Check out the documentation here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM