查看元件資訊

ffx component 指令可擷取裝置上的 Fuchsia 元件的各種類型資訊。

概念

ffx component list 指令會顯示 Fuchsia 裝置可用所有 Fuchsia 元件 (包括 v1 和 v2 元件) 的清單和階層。這項指令可協助您回答下列問題:

  • 裝置上有哪些元件?
  • 裝置上哪些子元件屬於父項元件?

ffx component show 指令會列印裝置上的 Fuchsia 元件詳細資料。這項指令可協助您回答下列問題 (和其他問題):

  • 我的裝置上存在哪個版本的元件?
  • 裝置上元件的執行個體 ID 為何?
  • 裝置上元件會提供給哪些服務及提供?

取得元件清單

如要查看 Fuchsia 裝置可用的元件清單,請執行下列指令:

ffx component list

這個指令會輸出類似以下的輸出內容:

$ tools/ffx component list
/
/bootstrap
/bootstrap/archivist
/bootstrap/base_resolver
/bootstrap/console
/bootstrap/console-launcher
/bootstrap/cr50_agent
/bootstrap/decompressor
/bootstrap/device_name_provider
/bootstrap/driver_index
/bootstrap/driver_manager
...
/core/wlancfg
/core/wlandevicemonitor
/core/wlanstack
/startup

取得元件的詳細資訊

如要查看 Fuchsia 裝置上特定元件的詳細資料,請執行下列指令:

ffx component show <COMPONENT>

COMPONENT 替換為 Fuchsia 元件的完整或部分部分。您也可以將 COMPONENT 替換成完整或部分元件網址。如有多個相符項目,這個指令會列印所有相符元件的詳細資料。

以下範例會輸出 brightness_manager 元件的詳細資料:

$ ffx component show brightness_manager
               Moniker: /core/brightness_manager
                   URL: fuchsia-pkg://fuchsia.com/brightness_manager#meta/brightness_manager.cm
                  Type: CML static component
       Component State: Resolved
           Instance ID: 8285f9d54645ea6baa7fd7b7905c7ae89a9daf8d5172be43b2587b166fd021af
 Incoming Capabilities: data
                        dev
                        fuchsia.logger.LogSink
                        pkg
  Exposed Capabilities: fuchsia.ui.brightness.Control
           Merkle root: a3b35183fbb3e49c450840f73043ee355d9e0d3673cc009c681f405816ea864e
       Execution State: Running
          Start reason: '/core/session-manager/session:session/workstation_session/login_shell/ermine_shell' requested capability 'fuchsia.ui.brightness.Control'
         Running since: 2022-04-11 20:54:05.139320126 UTC
                Job ID: 61155
            Process ID: 61188
 Outgoing Capabilities: fuchsia.ui.brightness.Control