Thursday, October 29, 2020

ionic common set of commands



build 

Build web assets and prepare your app for any platform targets



ionic capacitor add

add a native platform to your Ionic project


ionic capacitor add <platform> [options]

Supported one are 

ios, android, or electron



ionic capacitor build

Build an Ionic project for a given platform


ionic capacitor build <platform> [options]



onic capacitor build will do the following:


Perform ionic build

Copy web assets into the specified native platform

Open the IDE for your native project (Xcode for iOS, Android Studio for Android)

Once the web assets and configuration are copied into your native project, you can build your app using the native IDE. Unfortunately, programmatically building the native project is not yet supported.



ionic capacitor copy

Copy web assets to native platforms


ionic capacitor copy [<platform>] [options]


ionic capacitor copy will do the following:


Perform an Ionic build, which compiles web assets

Copy web assets to Capacitor native platform(s)



ionic capacitor open


ionic capacitor open <platform> [options]


ionic capacitor open will do the following:


Open the IDE for your native project (Xcode for iOS, Android Studio for Android)



ionic capacitor run


Run an Ionic project on a connected device


onic capacitor run will do the following:


Perform ionic build (or run the dev server from ionic serve with the --livereload option)

Copy web assets into the specified native platform

Open the IDE for your native project (Xcode for iOS, Android Studio for Android)


When using the --livereload option and need to serve to your LAN, a device, or an emulator, use the --external option also. Otherwise, the web view tries to access localhost.


Once the web assets and configuration are copied into your native project, the app can run on devices and emulators/simulators using the native IDE. Unfortunately, programmatically building and launching the native project is not yet supported.


ionic capacitor run

ionic capacitor run android

ionic capacitor run android -l --external

ionic capacitor run ios --livereload --external

ionic capacitor run ios --livereload-url=http://localhost:8100



ionic capacitor sync


ionic capacitor sync will do the following:

Perform an Ionic build, which compiles web assets

Copy web assets to Capacitor native platform(s)

Update Capacitor native platform(s) and dependencies

Install any discovered Capacitor or Cordova plugins




ionic capacitor update

Update Capacitor native platforms, install Capacitor/Cordova plugins


ionic capacitor update [<platform>] [options]


ionic capacitor update will do the following:


Update Capacitor native platform(s) and dependencies

Install any discovered Capacitor or Cordova plugins



ionic completion

Enables tab-completion for Ionic CLI commands.


ionic completion [options]


This command is experimental and only works for Z shell (zsh) and non-Windows platforms.


To enable completions for the Ionic CLI, you can add the completion code that this command prints to your ~/.zshrc (or any other file loaded with your shell). See the examples.


ionic completion

ionic completion >> ~/.zshrc



ionic config get

This command reads and prints configuration values from the project's ./ionic.config.json file. It can also operate on the global CLI configuration (~/.ionic/config.json) using the --global option.


ionic config get

ionic config get id

ionic config get --global user.email

ionic config get -g npmClient



references

https://ionicframework.com/docs/cli/commands/capacitor-add

No comments:

Post a Comment