Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trình mô phỏng Firebase giúp bạn dễ dàng xác thực đầy đủ hành vi của ứng dụng và xác minh cấu hình Firebase Security Rules. Sử dụng Trình mô phỏng Firebase để chạy và tự động hoá các kiểm thử đơn vị trong môi trường cục bộ.
Khởi động trình mô phỏng bằng lệnh sau. Trình mô phỏng sẽ chạy trong tất cả các bài kiểm thử của bạn.
Cloud Firestore
firebase emulators:start --only firestore
Realtime Database
firebase emulators:start --only database
Cloud Storage
firebase emulators:start --only storage
Thiết lập các chương trình kiểm thử và chạy trình mô phỏng
Giờ đây, sau khi cài đặt trình mô phỏng, bạn có thể thiết lập các kiểm thử và tạo báo cáo để xác thực hành vi của các quy tắc trước khi triển khai các quy tắc đó cho sản xuất.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["\u003cbr /\u003e\n\nThe Firebase Emulators make it easier to fully validate your app's behavior and\nverify your Firebase Security Rules configurations. Use the Firebase Emulators to\nrun and automate unit tests in a local environment.\n| **Beta**\n|\n| Some of the Firebase Emulators are currently in Beta. These\n| products might be changed in backward-incompatible ways and are not subject to\n| any SLA or deprecation policy. As always, feedback is greatly appreciated.\n| Let us know what you think!\n\nInstall the Firebase Emulators\n\nBefore you begin make sure you have installed the [Firebase CLI](/docs/cli)\nand configured the [Firebase Local Emulator Suite](/docs/emulator-suite/install_and_configure)\n\nStart the emulator using the following command. The emulator runs during\nall your tests. \n\nCloud Firestore \n\n```text\n firebase emulators:start --only firestore\n \n```\n\nRealtime Database \n\n```text\n firebase emulators:start --only database\n \n```\n\nCloud Storage \n\n```text\n firebase emulators:start --only storage\n \n```\n\nSet up tests and run the emulator\n\nNow that you've installed the emulator, [set up tests](/docs/rules/unit-tests) and\n[generate reports](/docs/rules/emulator-reports) to validate your rules' behavior before\nyou deploy them to production.\n\nQuickstart\n\nFor a few basic test cases with simple rules,\ntry out the [testing quickstart](https://github.com/firebase/quickstart-testing)."]]