A platform is the native wrapper for one target. cordova platform add fetches the platform package from npm 2,036 , generates its project under platforms/, and records the version in package.json:
cordova platform add android
cordova platform add browserUsing cordova-fetch for cordova-android Adding android project... ... Android Target SDK: android-36 Android Compile SDK: 36 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@15.1.0 Using cordova-fetch for cordova-browser ...
platforms/android is a complete Gradle 19,597 project: an app module with your web files and MainActivity, and CordovaLib, the Java runtime with the WebView and the bridge (Web App to Native App). In package.json, the CLI added "cordova-android": "^15.1.0" and "cordova-browser": "^7.0.0" to devDependencies and both names to the cordova.platforms list, so a teammate who clones the project restores the same versions with one cordova prepare. cordova platform ls lists platforms, cordova platform rm browser removes one, and cordova platform add android@15.1.0 pins a version. cordova platform add ios works on any system; on Linux it prints WARNING: Applications for platform ios can not be built on this OS - linux. and generates the Xcode 10 project anyway. Only building it needs macOS and Xcode (Adding iOS).