Firestoreのruleをローカルエミュレータでテストする為にCatalinaにJavaをインストールする

FirebaseのFirestoreのルールをローカルエミュレータでテストしようとして以下の記事を参考にセットアップを進めたらJavaがインストールされていないと怒られた。


スクリーンショット 2020-08-14 22.33.13

Javaのインストールは次のページを参考に、

homebrewを使っていたので以下のコマンドを実行。

brew cask install java

インストール完了後にバージョンを確認。

% java --version
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

エミュレータを起動。

% yarn firebase emulators:start --only firestore
yarn run v1.22.4
$ /Users/yorifuji/git/react-firebase-chat/node_modules/.bin/firebase emulators:start --only firestore
i  emulators: Starting emulators: firestore
i  firestore: Firestore Emulator logging to firestore-debug.log
i  ui: downloading ui-v1.1.1.zip...
Progress: =====================================================================================================================================> (100% of 4MB)
i  ui: Emulator UI logging to ui-debug.log
┌───────────────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! View status and logs at http://localhost:4000 │
└───────────────────────────────────────────────────────────────────────┘
┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator  │ Host:Port      │ View in Emulator UI             │
├───────────┼────────────────┼─────────────────────────────────┤
│ Firestore │ localhost:8080 │ http://localhost:4000/firestore │
└───────────┴────────────────┴─────────────────────────────────┘
 Other reserved ports: 4400, 4500
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.

表示されているURLにアクセスすると以下の画面が表示された。

スクリーンショット 2020-08-14 22.35.49

正常に起動できたと思われる。

この記事が気に入ったらサポートをしてみませんか?