20

Androidエミュレーターに奇妙な問題があります。Android AVDマネージャー(プラットフォーム2.1およびAPIレベル7で新しく作成されたエミュレーター)を使用して仮想デバイスを作成しました。標準設定と、より大きな(256 MB)デバイスRAMサイズのハードウェアパラメーターを追加して試しましたが、何も変更されていません。

プロジェクトをテストするためにファイルをシステムパーティションに移動する必要があります(haggleと呼ばれます)が、何らかの理由で、システムパーティションには最初からスペースがありません。

aa a@aaa /home/haggle-0.2-android
$ adb -s emulator-5554 shell

 # df
df
/dev: 47084K total, 0K used, 47084K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 73600K total, 73600K used, 0K available (block size 4096)
/data: 65536K total, 18464K used, 47072K available (block size 4096)
/cache: 65536K total, 1156K used, 64380K available (block size 4096)

ご覧のとおり、システムパーティションには0Kの空き容量があります。ルート権限を取得していないHTCNexusOneに接続して同じ操作を行うと、次の値が表示されます。

/dev: 108896K total, 0K used, 108896K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 148480K total, 116364K used, 32116K available (block size 4096)
/data: 200960K total, 22296K used, 178664K available (block size 4096)
/cache: 97280K total, 1852K used, 95428K available (block size 4096)
/sdcard: 3864064K total, 118496K used, 3745568K available (block size 32768)

エミュレータのシステムパーティションに最初から0Kの空き領域があるのはなぜですか?それを変更するにはどうすればよいですか?パーティションをマウント/再マウントで書き込み可能にしたとしても、同じ0K値を取得します。

任意のヒント?

4

5 に答える 5

29

Found the answer :)

When starting the emulator you can specify the partition size by -partition-size x emulator_name.

done through the terminal that is. Example:

emulator -partition-size 125 @AVD1

OR

emulator -partition-size 125 -avd AVD1

Note that the size must be bigger than your current system partition size. For the Android4.0.3 emulator the default size is already 168 so set your new partition-size to something bigger like 256

于 2010-04-23T11:36:57.290 に答える
12

現在、-partition-size/ system / dataパーティションは変更されていますが、/systemパーティションスペースは変更されていません。

たとえば、完全なGAppをインストールする場合は、より多くのスペースが必要になります。

Unixでこれを行う一般的な手順は、https://unix.stackexchange.com/questions/104790/how-to-setup-a-growable-loopback-deviceに記載されています。

要するに:

  1. SDKの元のコピーを変更しないようにsystem.imgのコピーを作成します(cp system.img system-extended.img
  2. system-extended.img希望のサイズに成長させます(例truncate system-extended.img -s 2G:)
  3. 内部ext4ファイルシステムのサイズを変更します(resizefs system-extended.imgOR resize2fs system-extended.img
  4. パラメータを介してエミュレータを呼び出すときは、新しいimgファイルを使用し-system <path/to/system-extended.img>ます。この-writable-systemパラメータも便利な場合があります。
于 2016-07-25T18:13:13.520 に答える
1

私はAndroidQ(それが重要な場合はAndroid TV)で@ssiceの答えを試すのに問題がありました。

どうやらsystem.imgはGPTパーティションディスクイメージになりました。

これを確認するには、次を実行しますfile system.img

system.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x87,130,59), startsector 1, 2177023 sectors, extended partition table (last)

これが当てはまる場合は、Linuxでできることは次のとおりです。

  1. system.imgのサイズを変更します:truncate -s 3G system.img
  2. パーティションテーブルを再作成し、それにまたがるパーティションを作成します。
    • fdisk system.img
    • g新しいGPTパーティションテーブル用
    • n新しいパーティションの場合。パーティション番号1を選択します。ディスク全体にまたがるパーティションのデフォルトを受け入れる
    • w変更を保存するため
$ fdisk system.img

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): g
Created a new GPT disklabel (GUID: 2E6B87B6-5492-47E0-A164-A148E24445A0).

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-6291422, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-6291422, default 6291422):

Created a new partition 1 of type 'Linux filesystem' and of size 3 GiB.

Command (m for help): w
The partition table has been altered.
Syncing disks.
  1. system.imgループバックデバイスとして マウント
    • losetup -fP system.img
    • から割り当てられたグラブ/dev/loopN(たとえば/dev/loop1losetup -a | grep system.img
  2. ファイルシステムのサイズ変更:(resize2fs /dev/loop1p1パーティション/dev/loop11)
于 2020-04-12T20:43:12.103 に答える
1

ソースから構築されたAndroid10エミュレーターの場合、次のソリューションが適切に機能します。

$ emulator -partition-size 8192 -writable-system

エミュレータをクリアして再構築する必要がある前にエミュレータが起動されている場合:

$ make installclean
$ rm out/target/product/generic_x86_64/*qcow2
$ make
$ emulator -partition-size 8192 -writable-system

aosp_car_x86_64ターゲットで正常にテストされました。

于 2020-04-17T07:47:37.773 に答える
0

問題を見つけました。SDK_MANAGERフォルダーは私のDディスク()の非標準文字ディレクトリ内にありD:/ასერ/?dwe + joan/SKD_MANAGER、それが正しいパーティションサイズを取得できなかった理由です。** SDK_MANAGER *をD:/ ** SDK_MANAGER *に移動し、問題を解決しました。

(したがって、「無効なシステムパーティションサイズ」や「パニック:avd1を開けませんでした」などのエラーメッセージが表示される場合は、この投稿が役立つ可能性があります)

于 2014-05-07T09:46:32.400 に答える