Ionic - Guide complet des options pour créer des applications mobiles Ionic

🏷️ Commandes & CLI 📅 03/04/2026 13:00:00 👤 Mezgani said
Ionic Ionic Cli Applications Mobiles Commandes Mobile Développement Mobile Cross-Platform Typescript Angular Framework Android Ios

Guide complet des commandes Ionic CLI. Découvrez toutes les options pour créer des applications mobiles Ionic avec efficacité et productivité.

Ligne de commande :
ionic start
Description :

Crée un nouveau projet Ionic

Options :
  • --type
  • --template
  • --cordova
  • --capacitor
  • --no-deps
  • --no-git
  • --no-link
  • --skip-deps
  • --skip-git
  • --skip-link
  • --id
  • --app-id
  • --package-id
  • --project-id
  • --no-interactive
  • --verbose

Ligne de commande :
ionic start monApp blank
Description :

Crée un projet avec le template blank

Options :
  • --type
  • --capacitor
  • --cordova

Ligne de commande :
ionic start monApp tabs
Description :

Crée un projet avec navigation par onglets

Options :
  • --type
  • --capacitor
  • --cordova

Ligne de commande :
ionic start monApp sidemenu
Description :

Crée un projet avec menu latéral

Options :
  • --type
  • --capacitor
  • --cordova

Ligne de commande :
ionic start monApp list
Description :

Crée un projet avec template liste

Options :
  • --type
  • --capacitor
  • --cordova

Ligne de commande :
ionic start monApp blank --type=angular
Description :

Crée un projet Ionic Angular

Options :
  • --type

Ligne de commande :
ionic start monApp blank --type=react
Description :

Crée un projet Ionic React

Options :
  • --type

Ligne de commande :
ionic start monApp blank --type=vue
Description :

Crée un projet Ionic Vue

Options :
  • --type

Ligne de commande :
ionic start monApp blank --type=ionic-angular
Description :

Crée un projet Ionic Angular (legacy)

Options :
  • --type

Ligne de commande :
ionic start monApp blank --capacitor
Description :

Crée un projet avec Capacitor (par défaut)

Options :
  • --capacitor

Ligne de commande :
ionic start monApp blank --cordova
Description :

Crée un projet avec Cordova

Options :
  • --cordova

Ligne de commande :
ionic start monApp https://github.com/user/custom-template
Description :

Crée un projet depuis un template personnalisé

Options :
  • --type

Ligne de commande :
ionic serve
Description :

Lance le serveur de développement

Options :
  • --port
  • -p
  • --host
  • --address
  • --external
  • --lab
  • --lab-host
  • --lab-port
  • --browser
  • --browser-target
  • --devapp
  • --open
  • --no-open
  • --ssl
  • --verbose
  • --prod
  • --watch
  • --no-watch
  • --livereload
  • --no-livereload
  • --consolelogs
  • --no-consolelogs
  • --serverlogs
  • --no-serverlogs

Ligne de commande :
ionic serve --port 8100
Description :

Lance sur un port personnalisé

Options :
  • --port
  • -p

Ligne de commande :
ionic serve --external
Description :

Lance et expose sur le réseau local

Options :
  • --external
  • --host

Ligne de commande :
ionic serve --lab
Description :

Lance en mode lab (vue iOS et Android côte à côte)

Options :
  • --lab
  • --lab-host
  • --lab-port

Ligne de commande :
ionic serve --ssl
Description :

Lance avec HTTPS

Options :
  • --ssl

Ligne de commande :
ionic serve --prod
Description :

Lance en mode production (optimisé)

Options :
  • --prod

Ligne de commande :
ionic serve --no-open
Description :

Lance sans ouvrir le navigateur

Options :
  • --no-open

Ligne de commande :
ionic build
Description :

Construit l'application pour la production

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs
  • --env
  • --verbose
  • --generateSourceMap
  • --sourceMap
  • --watch
  • --no-watch
  • --configuration
  • -c
  • --engine
  • --platform

Ligne de commande :
ionic build --prod
Description :

Construit en mode production

Options :
  • --prod

Ligne de commande :
ionic build --configuration=production
Description :

Construit avec une configuration spécifique

Options :
  • --configuration
  • -c

Ligne de commande :
ionic build --sourceMap
Description :

Construit avec source maps

Options :
  • --sourceMap
  • --generateSourceMap

Ligne de commande :
ionic generate
Description :

Génère des fichiers (pages, composants, services, etc.)

Options :
  • --flat
  • --export
  • --module
  • --skip-import
  • --spec
  • --routing
  • --lazy
  • --verbose

Ligne de commande :
ionic g
Description :

Alias de ionic generate

Options :
  • --flat
  • --export
  • --module
  • --skip-import
  • --spec

Ligne de commande :
ionic generate page MaPage
Description :

Génère une nouvelle page

Options :
  • --flat
  • --module
  • --spec
  • --routing

Ligne de commande :
ionic g p MaPage
Description :

Alias pour générer une page

Options :
  • --flat
  • --module

Ligne de commande :
ionic generate component MonComposant
Description :

Génère un nouveau composant

Options :
  • --flat
  • --export
  • --module
  • --skip-import
  • --spec

Ligne de commande :
ionic g c MonComposant
Description :

Alias pour générer un composant

Options :
  • --flat
  • --export

Ligne de commande :
ionic generate directive MaDirective
Description :

Génère une nouvelle directive

Options :
  • --flat
  • --export
  • --module
  • --skip-import
  • --spec

Ligne de commande :
ionic generate pipe MonPipe
Description :

Génère un nouveau pipe

Options :
  • --flat
  • --export
  • --module
  • --skip-import
  • --spec

Ligne de commande :
ionic generate service MonService
Description :

Génère un nouveau service

Options :
  • --flat
  • --spec

Ligne de commande :
ionic g s MonService
Description :

Alias pour générer un service

Options :
  • --flat

Ligne de commande :
ionic generate class MaClasse
Description :

Génère une nouvelle classe

Options :
  • --flat
  • --spec

Ligne de commande :
ionic generate guard MonGuard
Description :

Génère un nouveau guard de route

Options :
  • --flat
  • --spec
  • --implements

Ligne de commande :
ionic g g MonGuard
Description :

Alias pour générer un guard

Options :
  • --flat

Ligne de commande :
ionic generate interceptor MonInterceptor
Description :

Génère un nouvel intercepteur HTTP

Options :
  • --flat
  • --spec

Ligne de commande :
ionic generate resolver MonResolver
Description :

Génère un nouveau resolver de route

Options :
  • --flat
  • --spec

Ligne de commande :
ionic generate interface MonInterface
Description :

Génère une nouvelle interface TypeScript

Options :
  • --flat
  • --type

Ligne de commande :
ionic generate enum MonEnum
Description :

Génère une nouvelle énumération

Options :
  • --flat

Ligne de commande :
ionic cap add android
Description :

Ajoute la plateforme Android avec Capacitor

Options :
  • --verbose

Ligne de commande :
ionic cap add ios
Description :

Ajoute la plateforme iOS avec Capacitor

Options :
  • --verbose

Ligne de commande :
ionic cap add electron
Description :

Ajoute la plateforme Electron avec Capacitor

Options :
  • --verbose

Ligne de commande :
ionic cap copy
Description :

Copie le build web dans les projets natifs

Options :
  • --no-build
  • --verbose

Ligne de commande :
ionic cap copy android
Description :

Copie uniquement pour Android

Options :
  • --no-build
  • --verbose

Ligne de commande :
ionic cap copy ios
Description :

Copie uniquement pour iOS

Options :
  • --no-build
  • --verbose

Ligne de commande :
ionic cap sync
Description :

Copie le build et met à jour les plugins natifs

Options :
  • --no-build
  • --verbose

Ligne de commande :
ionic cap update
Description :

Met à jour les plugins Capacitor

Options :
  • --verbose

Ligne de commande :
ionic cap open android
Description :

Ouvre le projet dans Android Studio

Options :
  • --verbose

Ligne de commande :
ionic cap open ios
Description :

Ouvre le projet dans Xcode

Options :
  • --verbose

Ligne de commande :
ionic cap run android
Description :

Lance l'application sur un appareil Android

Options :
  • --target
  • --external
  • --live-reload
  • --livereload
  • --port
  • --host
  • --verbose
  • --no-build
  • --keystore
  • --keystore-password
  • --keystore-alias
  • --keystore-alias-password
  • --configuration
  • -c

Ligne de commande :
ionic cap run android --livereload
Description :

Lance avec live reload

Options :
  • --livereload
  • --external
  • --port

Ligne de commande :
ionic cap run android --target Pixel_4_API_33
Description :

Lance sur un émulateur spécifique

Options :
  • --target

Ligne de commande :
ionic cap run ios
Description :

Lance l'application sur un simulateur iOS

Options :
  • --target
  • --external
  • --live-reload
  • --livereload
  • --port
  • --host
  • --verbose
  • --no-build
  • --configuration
  • -c

Ligne de commande :
ionic cap run ios --livereload
Description :

Lance avec live reload sur iOS

Options :
  • --livereload
  • --external
  • --port

Ligne de commande :
ionic capacitor build android
Description :

Construit l'APK Android

Options :
  • --no-open
  • --keystore
  • --keystore-password
  • --keystore-alias
  • --keystore-alias-password
  • --configuration
  • -c
  • --verbose

Ligne de commande :
ionic capacitor build ios
Description :

Construit l'application iOS

Options :
  • --no-open
  • --configuration
  • -c
  • --verbose

Ligne de commande :
ionic cordova add android
Description :

Ajoute la plateforme Android avec Cordova

Options :
  • --verbose

Ligne de commande :
ionic cordova add ios
Description :

Ajoute la plateforme iOS avec Cordova

Options :
  • --verbose

Ligne de commande :
ionic cordova add browser
Description :

Ajoute la plateforme navigateur avec Cordova

Options :
  • --verbose

Ligne de commande :
ionic cordova rm android
Description :

Supprime la plateforme Android

Options :
  • --verbose

Ligne de commande :
ionic cordova platform add android
Description :

Ajoute une plateforme (syntaxe alternative)

Options :
  • --verbose

Ligne de commande :
ionic cordova platform rm android
Description :

Supprime une plateforme

Options :
  • --verbose

Ligne de commande :
ionic cordova plugin add cordova-plugin-camera
Description :

Ajoute un plugin Cordova

Options :
  • --verbose
  • --save
  • --variable

Ligne de commande :
ionic cordova plugin rm cordova-plugin-camera
Description :

Supprime un plugin Cordova

Options :
  • --verbose
  • --save

Ligne de commande :
ionic cordova plugin ls
Description :

Liste les plugins Cordova installés

Options :
  • --verbose

Ligne de commande :
ionic cordova prepare
Description :

Prépare le projet Cordova (copie www)

Options :
  • --no-build
  • --verbose

Ligne de commande :
ionic cordova build android
Description :

Construit l'APK Android avec Cordova

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs
  • --release
  • --device
  • --emulator
  • --buildConfig
  • --verbose

Ligne de commande :
ionic cordova build android --prod --release
Description :

Construit un APK release

Options :
  • --prod
  • --release
  • --buildConfig

Ligne de commande :
ionic cordova build ios
Description :

Construit l'application iOS avec Cordova

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs
  • --release
  • --device
  • --emulator
  • --buildConfig
  • --verbose

Ligne de commande :
ionic cordova run android
Description :

Lance l'application sur Android avec Cordova

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs
  • --release
  • --device
  • --emulator
  • --target
  • --livereload
  • --consolelogs
  • --serverlogs
  • --address
  • --port
  • --livereload-port
  • --buildConfig
  • --verbose

Ligne de commande :
ionic cordova run android --livereload
Description :

Lance avec live reload

Options :
  • --livereload
  • --address
  • --port

Ligne de commande :
ionic cordova run ios
Description :

Lance l'application sur iOS avec Cordova

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs
  • --release
  • --device
  • --emulator
  • --target
  • --livereload
  • --consolelogs
  • --serverlogs
  • --address
  • --port
  • --livereload-port
  • --buildConfig
  • --verbose

Ligne de commande :
ionic cordova requirements
Description :

Vérifie les prérequis Cordova

Options :
  • --verbose

Ligne de commande :
ionic cordova resources
Description :

Génère les ressources (icônes et splash screens)

Options :
  • --icon
  • --splash
  • --verbose

Ligne de commande :
ionic cordova resources android
Description :

Génère les ressources pour Android

Options :
  • --icon
  • --splash
  • --verbose

Ligne de commande :
ionic cordova resources ios
Description :

Génère les ressources pour iOS

Options :
  • --icon
  • --splash
  • --verbose

Ligne de commande :
ionic integrations enable capacitor
Description :

Active l'intégration Capacitor

Options :
  • --verbose

Ligne de commande :
ionic integrations enable cordova
Description :

Active l'intégration Cordova

Options :
  • --verbose

Ligne de commande :
ionic integrations disable capacitor
Description :

Désactive l'intégration Capacitor

Options :
  • --verbose

Ligne de commande :
ionic integrations list
Description :

Liste les intégrations actives

Options :
  • --verbose

Ligne de commande :
ionic deploy add
Description :

Ajoute Ionic Deploy (Appflow)

Options :
  • --app-id
  • --channel-name
  • --update-method
  • --verbose

Ligne de commande :
ionic deploy configure
Description :

Configure Ionic Deploy

Options :
  • --app-id
  • --channel-name
  • --update-method
  • --verbose

Ligne de commande :
ionic deploy build
Description :

Construit un déploiement Appflow

Options :
  • --environment
  • --channel
  • --commit
  • --verbose

Ligne de commande :
ionic deploy manifest
Description :

Génère le manifeste de déploiement

Options :
  • --verbose

Ligne de commande :
ionic config get
Description :

Affiche une valeur de configuration

Options :
  • --verbose
  • --json
  • --root
  • --global
  • --project
  • --property
  • -p

Ligne de commande :
ionic config set
Description :

Définit une valeur de configuration

Options :
  • --verbose
  • --json
  • --root
  • --global
  • --project
  • --property
  • -p
  • --value

Ligne de commande :
ionic config unset
Description :

Supprime une valeur de configuration

Options :
  • --verbose
  • --json
  • --root
  • --global
  • --project
  • --property
  • -p

Ligne de commande :
ionic config set -g backend pro
Description :

Définit une configuration globale

Options :
  • -g
  • --global

Ligne de commande :
ionic login
Description :

Se connecte à Ionic Pro / Appflow

Options :
  • --email
  • --password
  • --verbose

Ligne de commande :
ionic logout
Description :

Se déconnecte de Ionic Pro

Options :
  • --verbose

Ligne de commande :
ionic signup
Description :

Crée un compte Ionic Pro

Options :
  • --email
  • --password
  • --verbose

Ligne de commande :
ionic link
Description :

Lie le projet local à Ionic Pro

Options :
  • --id
  • --name
  • --verbose
  • --no-interactive

Ligne de commande :
ionic link --id abc123
Description :

Lie avec un App ID spécifique

Options :
  • --id

Ligne de commande :
ionic unlink
Description :

Délie le projet de Ionic Pro

Options :
  • --verbose

Ligne de commande :
ionic ssh add
Description :

Ajoute une clé SSH à Ionic Pro

Options :
  • --use
  • --name
  • --pub-file
  • --verbose

Ligne de commande :
ionic ssh list
Description :

Liste les clés SSH

Options :
  • --verbose

Ligne de commande :
ionic ssh delete
Description :

Supprime une clé SSH

Options :
  • --id
  • --verbose

Ligne de commande :
ionic ssh generate
Description :

Génère une nouvelle clé SSH

Options :
  • --filename
  • --passphrase
  • --verbose

Ligne de commande :
ionic ssh use
Description :

Définit la clé SSH active

Options :
  • --id
  • --verbose

Ligne de commande :
ionic ssh setup
Description :

Configure les clés SSH pour Ionic Pro

Options :
  • --verbose

Ligne de commande :
ionic git remote
Description :

Ajoute le remote Git d'Appflow

Options :
  • --verbose

Ligne de commande :
ionic git clone
Description :

Clone un projet depuis Appflow

Options :
  • --app-id
  • --verbose

Ligne de commande :
ionic monitoring syncmaps
Description :

Synchronise les source maps pour Ionic Monitoring

Options :
  • --verbose

Ligne de commande :
ionic package build android
Description :

Package l'application Android via Ionic Package

Options :
  • --profile
  • --no-resources
  • --verbose

Ligne de commande :
ionic package build ios
Description :

Package l'application iOS via Ionic Package

Options :
  • --profile
  • --no-resources
  • --verbose

Ligne de commande :
ionic package list
Description :

Liste les builds de package

Options :
  • --verbose

Ligne de commande :
ionic package info
Description :

Affiche les infos d'un build de package

Options :
  • --id
  • --verbose

Ligne de commande :
ionic package download
Description :

Télécharge un build de package

Options :
  • --id
  • --destination
  • --verbose

Ligne de commande :
ionic doctor check
Description :

Vérifie l'état du projet Ionic

Options :
  • --verbose

Ligne de commande :
ionic doctor treat
Description :

Corrige automatiquement les problèmes détectés

Options :
  • --verbose

Ligne de commande :
ionic doctor list
Description :

Liste les problèmes potentiels

Options :
  • --verbose

Ligne de commande :
ionic info
Description :

Affiche les informations système

Options :
  • --json
  • --verbose

Ligne de commande :
ionic repair
Description :

Répare l'installation Ionic

Options :
  • --verbose

Ligne de commande :
ionic completion
Description :

Génère l'autocomplétion pour le shell

Options :
  • --bash
  • --zsh
  • --fish
  • --verbose

Ligne de commande :
ionic completion --bash
Description :

Génère l'autocomplétion pour bash

Options :
  • --bash

Ligne de commande :
ionic completion --zsh
Description :

Génère l'autocomplétion pour zsh

Options :
  • --zsh

Ligne de commande :
ionic completion --fish
Description :

Génère l'autocomplétion pour fish

Options :
  • --fish

Ligne de commande :
ionic enterprise register
Description :

Enregistre Ionic Enterprise

Options :
  • --key
  • --app-id
  • --verbose

Ligne de commande :
ionic share
Description :

Partage l'application via Ionic View (déprécié)

Options :
  • --note
  • --verbose

Ligne de commande :
ionic upload
Description :

Upload l'application vers Ionic View (déprécié)

Options :
  • --note
  • --deploy
  • --verbose

Ligne de commande :
ionic capacitor update android --variable ANDROID_COMPILE_SDK_VERSION=33
Description :

Met à jour les variables de build Android

Options :
  • --variable

Ligne de commande :
ionic capacitor update ios --variable IOS_DEPLOYMENT_TARGET=13.0
Description :

Met à jour les variables de build iOS

Options :
  • --variable

Ligne de commande :
ionic build --prod --aot --minifyjs --minifycss --optimizejs
Description :

Build optimisé complet

Options :
  • --prod
  • --aot
  • --minifyjs
  • --minifycss
  • --optimizejs

Ligne de commande :
ionic cap run android --external --livereload --port 8100
Description :

Live reload complet sur Android

Options :
  • --external
  • --livereload
  • --port

Ligne de commande :
ionic cap run ios --external --livereload --port 8100
Description :

Live reload complet sur iOS

Options :
  • --external
  • --livereload
  • --port

Ligne de commande :
ionic cordova build android --prod --release -- -- --gradleArg=-Pandroid.injected.signing.store.file=keystore.jks
Description :

Build Android avec signature personnalisée

Options :
  • --prod
  • --release
  • --

Ligne de commande :
ionic cordova build ios --prod --release -- --developmentTeam=TEAMID --codeSignIdentity="iPhone Distribution"
Description :

Build iOS avec signature personnalisée

Options :
  • --prod
  • --release
  • --

Ligne de commande :
ionic deploy add --app-id=abc123 --channel-name="production" --update-method=background
Description :

Configure Appflow Deploy

Options :
  • --app-id
  • --channel-name
  • --update-method

Ligne de commande :
ionic cap open android --configuration=production
Description :

Ouvre Android Studio avec une configuration

Options :
  • --configuration
  • -c

Ligne de commande :
ionic cap open ios --configuration=production
Description :

Ouvre Xcode avec une configuration

Options :
  • --configuration
  • -c

Ligne de commande :
ionic cordova plugin add cordova-plugin-device --save
Description :

Ajoute un plugin et sauvegarde dans config.xml

Options :
  • --save

Ligne de commande :
ionic cordova plugin add https://github.com/user/custom-plugin.git
Description :

Ajoute un plugin depuis Git

Options :
  • --save

Ligne de commande :
ionic cordova plugin add /path/to/local/plugin
Description :

Ajoute un plugin local

Options :
  • --save

Ligne de commande :
ionic generate page MaPage --module=app
Description :

Génère une page et l'ajoute au module spécifié

Options :
  • --module

Ligne de commande :
ionic generate component MonComposant --export
Description :

Génère un composant exportable

Options :
  • --export

Ligne de commande :
ionic generate service MonService --skip-import
Description :

Génère sans l'ajouter automatiquement aux providers

Options :
  • --skip-import

Ligne de commande :
ionic cap sync --no-build
Description :

Synchronise sans rebuild le projet web

Options :
  • --no-build

Ligne de commande :
ionic cordova prepare --no-build
Description :

Prépare Cordova sans rebuild

Options :
  • --no-build

Ligne de commande :
ionic cordova run android --target=emulator-5554
Description :

Lance sur un émulateur spécifique

Options :
  • --target

Ligne de commande :
ionic cordova run ios --target="iPhone 15 Pro"
Description :

Lance sur un simulateur iOS spécifique

Options :
  • --target

Ligne de commande :
ionic cap run android --target=emulator-5554
Description :

Lance Capacitor sur un émulateur spécifique

Options :
  • --target

Ligne de commande :
ionic cap run ios --target="iPhone 15 Pro"
Description :

Lance Capacitor sur un simulateur iOS spécifique

Options :
  • --target

Ligne de commande :
ionic cordova resources android --icon
Description :

Génère uniquement les icônes Android

Options :
  • --icon

Ligne de commande :
ionic cordova resources ios --splash
Description :

Génère uniquement les splash screens iOS

Options :
  • --splash

Ligne de commande :
ionic cordova build android --prod --release --buildConfig=build.json
Description :

Build avec fichier de configuration

Options :
  • --buildConfig

Ligne de commande :
ionic doctor treat --issue=node_modules
Description :

Traite un problème spécifique

Options :
  • --issue

Ligne de commande :
ionic config set -g npmClient yarn
Description :

Définit yarn comme client npm global

Options :
  • -g
  • --global

Ligne de commande :
ionic config set -g npmClient pnpm
Description :

Définit pnpm comme client npm global

Options :
  • -g
  • --global

Ligne de commande :
ionic help
Description :

Affiche l'aide générale d'Ionic CLI

Options :
  • --verbose
  • <commande>