Ionic – Cheat Sheet

Table of Contents



// ionic generate <type> <name> [options]
ionic g page "NAME_PAGE" 
ionic g page pages/"NAME_PAGE" // Creates a new page in folder "pages"
// g = generate
ionic generate
ionic generate page
ionic generate page contact
ionic generate component contact/form
ionic generate component login-form --change-detection=OnPush
ionic generate directive ripple --skip-import
ionic generate service api/user
					// Start a new project
ionic start "PROJECT_NAME"
ionic build
ionic serve

					// ionic serve --opt
ionic serve
ionic serve --external
ionic serve --lab
ionic serve -- --proxy-config proxy.conf.json
					// installs all dependencis in your project
cd myApp
npm install
					// Install Ionic framework and create your first project
npm install -g @ionic/cli
ionic start myApp tabs
cd myApp
ionic serve
					// add android support
ionic capacitor add android
ionic capacitor copy android
					// add android support and build/starts android sdk
ionic build				// build if never built
ionic cap add android	// add android support if not added while start
ionic cap copy			// 
ionic cap sync			// update Project Data
ionic cap open android  // opens Project in Android Studio