mksdcard
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
mksdcard
ツールを使用すると、FAT32 ディスク イメージを作成して、複数の異なる Android Virtual Device(AVD)を実行するエミュレータに読み込ませることで、複数のデバイスに同じ SD カードが存在する場合をシミュレートできます。
Android SDK Tools パッケージで提供される mksdcard
ツールは、android-sdk/emulator/mksdcard
にあります。
複数の仮想デバイス間で共有できるディスク イメージが不要な場合は、mksdcard
コマンドを使用する必要はありません。デフォルトでは、エミュレータはアクティブな AVD によって生成されて保存されたデフォルト イメージを代わりに使用します。
使用方法
mksdcard
ツールを使用するには、次のコマンドを使用します。
mksdcard -l label size file
オプション
mksdcard
のコマンドライン オプションの説明を次の表に示します。
オプション |
説明 |
-l label |
作成するディスク イメージのボリューム ラベル。 |
size |
作成するディスク イメージのサイズを表す整数。
size が単純な整数である場合は、バイト単位でサイズを指定します。size に K、M、または G を付加して、キロバイト、メガバイト、またはギガバイト単位でサイズを指定することもできます。たとえば、1048576K や 1024M のように指定します。最小サイズは 9M です。これより小さいイメージは Android Emulator で使用できません。最大サイズは 1,099,511,627,264 バイトです。これは 1,023 GB に相当します。
|
file |
作成するディスク イメージのパス / ファイル名。現在の作業ディレクトリを基準とする相対パスを指定します。
|
例
mySdCardFile.img
ディスク イメージを作成します。
mksdcard -l mySdCard 1024M mySdCardFile.img
2 種類の AVD を実行する 2 つのエミュレータを起動します。-sdcard
フラグを使用して、作成したディスク イメージの名前とパスを指定します。
emulator -avd Pixel_API_25 -sdcard mySdCardFile.img
emulator -avd NEXUS_6_API_25 -sdcard mySdCardFile.img
詳細については、
emulator
コマンドとそのオプション、
コマンドラインからエミュレータを起動するをご覧ください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# mksdcard\n\nUse the `mksdcard` tool to create a FAT32 disk image that you can load into\nemulators running different Android Virtual Devices (AVDs) to simulate the presence\nof the same SD card in multiple devices.\n\n\nThe `mksdcard` tool provided in the Android SDK Tools package\nis located in \u003cvar translate=\"no\"\u003eandroid-sdk\u003c/var\u003e`/emulator/`\u003cvar translate=\"no\"\u003emksdcard\u003c/var\u003e.\n\n\nIf you don't need a disk image that can be shared\namong multiple virtual devices, you don't need to use the `mksdcard` command.\nBy default, the emulator uses the default image that is generated by and stored with the\nactive AVD instead.\n\n### Usage\n\n\nTo use the `mksdcard` tool, use the following command:\n\n```\nmksdcard -l label size file\n```\n\n### Options\n\nThe following table describes the command-line options of `mksdcard`:\n\n| Option | Description |\n|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `-l `\u003cvar translate=\"no\"\u003elabel\u003c/var\u003e | A volume label for the disk image to create |\n| \u003cvar translate=\"no\"\u003esize\u003c/var\u003e | An integer that specifies the size of the disk image to create. If \u003cvar translate=\"no\"\u003esize\u003c/var\u003e is a simple integer, it specifies the size in bytes. You can also specify the size in kilobytes, megabytes, or gigabytes by appending K, M, or G to \u003cvar translate=\"no\"\u003esize\u003c/var\u003e. For example, `1048576K` or `1024M`. The minimum size is 9M. The Android emulator cannot use smaller images. The maximum size is 1099511627264 bytes, which equates to 1023 GB. |\n| \u003cvar translate=\"no\"\u003efile\u003c/var\u003e | The path/filename of the disk image to create relative to the current working directory. |\n\n### Example\n\n\nCreate the `mySdCardFile.img` disk image: \n\n```\nmksdcard -l mySdCard 1024M mySdCardFile.img\n```\n\n\nStart two emulators with different AVDs. Use the `-sdcard` flag to specify the name\nand path of the disk image you created: \n\n```\nemulator -avd Pixel_API_25 -sdcard mySdCardFile.img\nemulator -avd NEXUS_6_API_25 -sdcard mySdCardFile.img\n```\nFor more information about the `emulator` command and its options, see [Start the emulator from the command line](/studio/run/emulator-commandline)."]]