Skip to content

Instantly share code, notes, and snippets.

@tareq3
Last active December 19, 2018 13:40
Show Gist options
  • Save tareq3/f78a5b720ce728031d80958f28ee2fce to your computer and use it in GitHub Desktop.
Save tareq3/f78a5b720ce728031d80958f28ee2fce to your computer and use it in GitHub Desktop.
Ionic 4 and angular and cordova cli
### Preparing the platforms :
#### 1: install node with npm
#### 2: install ionic
```
npm i -g ionic
```
#### 3: install cordova and jdk
```
npm i -g cordova
```
### Show List of ionic project template available
```
ionic start --list
```
### start ionic project
```
ionic start project_name --type=Type_name
EX: ionic start ionic4Test --type=angular
```
### Run app using browser
```
ionic serve
```
### Run app in ionic lab
```
ionic serve -l
```
### Integrate cordova with ionic app
```
inside project
For Android:
ionic cordova platform add android
For Ios:
ionic cordova platform add ios
For Browser:
ionic cordova platform add browser
```
### Remove platform Integration from project
```
ionic cordova platform rm ios
```
### Generate apk file using cordova
```
ionic cordova build android
```
## To run it on android devices [emulator + real]
```
ionic cordova run android
```
### To run it on android real devices
```
ionic cordova run android --device
```
### Run or Emulate app on Browser
```
ionic cordova emulate browser
```
### Emulate app On Real android emulator
#### First show the list of emulator available for andoid
```
ionic cordova emulate android --list
```
#### Run the app on Any android emulator
```
ionic cordova emulate android --target=emulator_Name
```
### Ionic generate page, module ,service etc
```
ionic g
```
### Ionic generate files in test mode
```
ionic g page Page_Name --dry-run
```
### Quick generate a module along with routing
```
ionic g module --routing
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment