我正在尝试将HOSTS文件复制到使用jenkins中的android-emulator-plugin创建的avd中。我已经将partition-size指定为128,从命令行运行时工作正常,但是当我将hosts文件复制到/ system / etc / hosts时,它总是在推送期间返回内存不足错误。构建的输出如下:
/Users/Shared/Jenkins/Home/tools/android-sdk/tools/emulator -no-boot-anim -ports 5644,5645 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_240_WXGA720_android-17_x86_blackwidow_integration_test -no-snapshot-load -no-snapshot-save -no-window -partition-size 128
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
emulator: WARNING: 1: key name doesn't start with valid character. line ignored
Failed to create Context 0x3005
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
HAX is working and emulator runs in fast virt mode
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb connect emulator-5644
[android] Waiting for emulator to finish booting...
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5644 shell getprop dev.bootcomplete
error: device offline
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5644 shell getprop dev.bootcomplete
error: device offline
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5644 shell getprop dev.bootcomplete
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5644 logcat -v time
[android] Emulator is ready for use (took 35 seconds)
[android] Searching for Android projects...
[android] Project file 'smartfusion-android/project.properties' requires platform 'android-21'
[android] Ensuring platform(s) are installed: [android-21]
$ /Users/Shared/Jenkins/Home/tools/android-sdk/tools/android list target
[fusion-android] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson4186611571599232820.sh
+ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb remount
remount succeeded
+ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb push hosts.txt /system/etc/hosts
failed to copy 'hosts.txt' to '/system/etc/hosts': Out of memory
Build step 'Execute shell' marked build as failure
[android] Stopping Android emulator
我有什么魔法吗?
答案 0 :(得分:1)
你确定128MB足够吗?
我刚创建了一个android-15 x86模拟器,在有足够的可用空间写入之前,它需要一个至少220MB左右的分区大小。
您可以通过adb shell df /system
检查启动后的分区大小。