Cordova: Command Line Interface
Command Line Interface(CLI) is a text-based interface that is used to operate software and operating systems while allowing the user to respond to visual prompts by typing simple commands into the interface and receiving a reply in the same way. CLI is quite different from the Graphical User Interface(GUI) that is presently being used in the latest operating systems.
We also call it Terminal in Mac OS or Command Prompt in Windows operating system.
- In Linux Or Mac we call it Native CLI Terminal.
- In Windows we call it Native CLI CMD(Command Prompt).
What role does CLI play in Cordova?
- Cordova is totally dependent on CLI, so without it we can't execute a single process.
- It is used,
- To create a cordova project.
- To add platform for which we want to develop app.
- To add plugins.
- To generate APK.
For these listed tasks, we have to pass command line arguments.
How to open CMD in Windows OS?
- Search cmd in the Menu search bar by typing cmd or command prompt, then click on the Command Prompt App option in search results.
- We can also press
Ctrl + R
to open RUN dialog box, and type in cmd to open Command Prompt.
- It will open a black colored screen, this is the command prompt. Step 1 will open cmd in normal mode.
- To open command prompt in administrator mode, search cmd in searchbar and click right button of mouse and choose option Run as administrator.
Following are some useful commands, used in day-to-day work:
cls
→ Clear the Command Prompt screen
cd [directory_path]
→ To go to any directory
cd ..
→ To come out of any directory, to its immediate parent directory.
mkdir [directory_name]
→ This command is used to create any directory.
ipconfig
→ To get information about your IP address and DNS related info.
Opening Terminal in Mac OS
- Press
Command + Space
to open Spotlight Search, and type terminal in the search field.
- And click on the Terminal - Utilities option to open the Terminal.