image, imgimage, img

管理映像。Manages images.

作業Operation 說明Description
package-applicationpackage-application 建立映像套件Creates an image package
package-board-configpackage-board-config 建立電路板組態映像套件Creates a board configuration image package
showshow 顯示映像套件相關詳細資料Displays details about an image package

package-applicationpackage-application

從已編譯和連結的映像和 app_manifest.json 檔案建立可執行的應用程式。Creates an executable application from a compiled and linked image and an app_manifest.json file.

Visual Studio 會將應用程式的二進位檔自動重新命名為 /bin/app,因此 Visual Studio 專案名稱可以包含標點符號,而不會造成任何錯誤。Visual Studio automatically renames the binary file for the application to /bin/app, so the Visual Studio project name can include punctuation without causing any errors.

即時可用的應用程式 (RTApps) 是建置為 ELF 或 AXF 檔案,而不是原始的二進位檔。Real-time capable applications (RTApps) are built as ELF or AXF files and not as raw binaries. 請在封裝 RTApp 之前,先編輯應用程式資訊清單檔案,讓 ApplicationType 設定為 "RealTimeCapable",並讓 EntryPoint 設定為 ELF 或 AXF 檔案 (必須位於應用程式的根目錄中) 的名稱。Before packaging an RTApp, edit the application manifest file so that ApplicationType is set to "RealTimeCapable", and EntryPoint is set to the name of the ELF or AXF file, which must be in the root of the application directory.

必要參數Required parameters

參數Parameter 說明Description
-i, --input path-i, --input path 識別輸入目錄,該目錄會作為 Azure Sphere 映像檔案的系統根目錄。Identifies the input directory, which is used as the system root for the Azure Sphere image file. 應用程式的 app_manifest.json 檔案必須位於此目錄中。The app_manifest.json file for the application must be in this directory.
-o, --output file-o, --output file 指定輸出映像套件的檔案名稱。Specifies a filename for the output image package.

選擇性參數Optional parameters

參數Parameter 說明Description
-h, --hardwaredefinition path-h, --hardwaredefinition path 用來將 app_manifest.json 中的周邊設備名稱對應至底層值之硬體定義 JSON 檔案的選擇性路徑。Optional path to a hardware definition JSON file that is used to map peripheral names in app_manifest.json to underlying values. 您可以提供相對或絕對路徑。You may provide a relative or absolute path. 如需詳細資訊,請參閱硬體定義See hardware definition for more information.
-s, --sysroot sysroot-name-s, --sysroot sysroot-name 編譯期間使用的 sysroot 名稱。Name of the sysroot used during compilation. 輸出二進位檔映像套件會包含修改過的應用程式資訊清單和中繼資料,以反映此 sysroot 所代表的 API 集。The output binary image package will contain a modified application manifest and metadata that reflect the API set that this sysroot represents. 如需詳細資訊,請參閱使用搶鮮版 (Beta) APISee Use beta API for more information.
-x, --executables executable1,executable2-x, --executables executable1,executable2 要在映像套件中標示為可執行檔的一或多個檔案的子路徑。Subpaths to one or more files to mark as executable in the image package. app_manifest 檔案中所列的 EntryPoint 一會都標示為可執行檔,因此出現其他可執行檔時,才需要 -x 旗標。The EntryPoint listed in the app_manifest files is always marked as executable, so the -x flag is required only if other executables are present.

根據預設,這些檔案在封裝至映像時不可執行。By default, files are not executable when packaged into an image. 子路徑相對於 --input pathThe subpaths are relative to the --input path. 路徑可以使用 Windows 檔名語法 (反斜線) 或 Linux 檔名語法 (正斜線);不允許使用空格、逗號和分號。The paths can use either Windows filename syntax (backslashes) or Linux filename syntax (forward slashes); spaces, commas, and semicolons are not allowed. 您可以針對每個可執行檔指定 -x,或只使用一次並提供多個路徑 (以逗號分隔且其間沒有空格)。You can either specify -x for each executable file, or use it only once and supply multiple paths separated by commas without intervening spaces.
全域參數Global parameters

參數Parameter 說明Description
-v, --verbose-v, --verbose 提供詳細資訊輸出Provides verbose output
-?, --help-?, --help 顯示命令的說明Displays help on the command

範例Example

azsphere image package-application --input bin --output myimage.imagepackage

package-board-configpackage-board-config

建立面板組態映像套件。Creates a board configuration image package. 您可以使用預設的面板組態映像,或提供自訂的組態映像。You may either use a preset board configuration image or provide a custom configuration image.

必要參數Required parameters

參數Parameter 說明Description
-o, --output filename -o, --output filename 指定輸出映像套件的檔案名稱。Specifies a filename for the output image package.

選擇性參數Optional parameters

參數Parameter 說明Description
-c, --componentid GUID-c, --componentid GUID 指定組態套件的元件識別碼。Specifies the component ID for the configuration package. 若未提供識別碼,則會自動產生。If the ID is not provided, it will be automatically generated.
-i, --input path-i, --input path 識別面板組態映像的路徑。Identifies the path to the board configuration image. 如果包含此參數,則不可使用 --preset;這兩個參數是互斥的。If this is included, --preset must not be used; the two parameters are mutually exclusive.
-n, --name package-name -n, --name package-name 在所建立檔案的中繼資料中設定映像套件名稱。Sets the image package name in the created file's metadata. 若未提供,系統會根據所提供的面板組態,並納入元件識別碼的一部分來產生新名稱,以確保名稱是唯一的。If not provided, a new name will be generated based on the provided board configuration, incorporating part of the component ID for uniqueness.
-p, --preset string -p, --preset string 可提供要套用之預設面板設定映像的識別碼。Provides the ID of the preset board configuration image to apply. 請將此旗標與預設套件的識別碼搭配使用,或是為自訂面板組態映像提供 --input。Either use this flag with the ID of a preset package, or provide --input for a custom board configuration image. 此識別碼為列舉值,且目前固定為單一值 "lan-enc28j60-isu0-int5"。The ID is an enumeration value and is currently fixed to the single value "lan-enc28j60-isu0-int5".
全域參數Global parameters

參數Parameter 說明Description
-v, --verbose-v, --verbose 提供詳細資訊輸出Provides verbose output
-?, --help-?, --help 顯示命令的說明Displays help on the command

範例Example

azsphere image package-board-config --preset lan-enc28j60-isu0-int5 --output c:\output\myBoardConfig.imagepackage

顯示show

顯示映像套件相關資訊。Displays information about an image package.

必要參數Required parameters

參數Parameter 說明Description
-f, --filepath filename-f, --filepath filename 指定映像套件的路徑。Specifies the path to the image package.
全域參數Global parameters

參數Parameter 說明Description
-v, --verbose-v, --verbose 提供詳細資訊輸出Provides verbose output
-?, --help-?, --help 顯示命令的說明Displays help on the command

範例Example

azsphere image show --filepath "C:\Users\User\Documents\Visual Studio 2017\Projects\Mt3620Blink1\Mt3620Blink1\bin\ARM\Debug\Mt3620Blink1.imagepackage"
Image package metadata:
  Section: Identity
    Image Type:           Application
    Component ID:         6f68266c-b78b-405e-a47a-72b38b9517ed
    Image ID:             06ea8ade-0773-4d54-a76a-41a567d46bbd
  Section: Signature
    Signing Type:         ECDsa256
    Cert:                 a8d5cc6958f48710140d7a26160fc1cfc31f5df0
  Section: Debug
    Image Name:           Mt3620Blink50
    Built On (UTC):       23/10/2018 17:03:33
    Built On (Local):     23/10/2018 18:03:33
  Section: Temporary Image
    Remove image at boot: False
    Under development:    True
  Section: ABI Depends
    Depends on:           ApplicationRuntime, version 1

Command completed successfully in 00:00:00.3099684..