I am starting to learn Ionic, and on building my first application, when typing the
ionic platform add android
it says that the command has been renamed. My question is, what was it changed with?
In the tutorial I follow, it says to execute the commands
ionic platform add android
ionic build android
ionic run android
On searching the web, I have come across the command
ionic cordova run android
and it also said that cordova was moved to a CLI which also has to be installed.
But what about “add” and “build”? They are not required anymore?
Thank you.
ionic cordova platform add android
1 Like
ionic would be showing the renamed command once you execute any of the old ionic command… As ionic has started supporting web application development, ionic cli requires the end platform (cordova) appended in command for building in proper format.
ionic platform add android -> ionic cordova platform add android
.
As part of this, every ionic command checks the requirement for that command and if anyone of the requirment is not met, ionic executes those steps automatically. so
ionic cordova run android
checks whether android platform is added to the project, if it’s not, it automatically adds android platform to the project (saves in package.json), builds android apk file and runs in connected device or emulator.
2 Likes