4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ionic よく使うであろうコマンド コピペ用(capacitor)

Last updated at Posted at 2019-11-18

#テストの時

ブラウザで開く
ionic serve

ビルド
ionic build

copy
npx cap copy

IDEを開く
npx cap open ios
npx cap open android

#各種バージョンなどの確認

ionic info

Ionic:

   Ionic CLI                     : 6.17.1 (/Users/user/.nodebrew/node/v14.17.2/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.1.0
   @angular-devkit/build-angular : 0.901.9
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 9.1.4
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI      : 3.0.2
   @capacitor/android : 3.0.2
   @capacitor/core    : 3.0.2
   @capacitor/ios     : 3.0.2

#プラグイン関係
##プラグインの追加

npm install plugin-name

##プラグインを同期

npx cap sync

capacitorでcordovaのプラグインを使う場合は必須っぽい。

##プラグインのアップデート

npm install plugin-name@latest
npx cap update

##プラグインを削除

npm uninstall plugin-name
npx cap sync

#新しく作る時
##新規プロジェクト作成

ionic start myApp blank --capacitor

##既存のionicプロジェクトにcapacitorを入れる

ionic integrations enable capacitor

##アプリの初期設定

npx cap init [appName] [appId]

appIdはcom.example.appみたいなやつ。

##ビルド

ionic build

ネイティブプラットフォームを追加する前にする必要あり。

##新規プラットフォームの追加

npx cap add ios
npx cap add android
4
5
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?