启动模拟器
emulator
command not found
错误, 你肯定是在没有导入环境的窗口执行 emulator 了
-bash: emulator: command not found
这里要先导入环境, 如下
. build/envsetup.sh
选择运行的项目 (这个和你编译的一样)
lunch aosp_arm-eng
ANDROID_PRODUCT_OUT
找不到环境变量 ANDROID_PRODUCT_OUT
emulator: ERROR: Can't access ANDROID_PRODUCT_OUT as '源码路径/out/target/product/geneic_aosp_arm-eng'
直接在当前终端窗口增加这个环境变量, 改到你已经编译好的项目路径
export ANDROID_PRODUCT_OUT=源码路径/out/target/product/generic_aosp_arm-eng
然后再次
emulator
启动成功
打印如下
emulator: WARNING: system partition size adjusted to match image file (1536 MB > 200 MB)
emulator: WARNING: data partition size adjusted to match image file (550 MB > 200 MB)
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: ### WARNING: /etc/localtime does not point to /usr/share/zoneinfo/, can't determine zoneinfo timezone name
开机等了十来分钟(网上都说几分钟, 估计是我机子太垃圾...)
partition
分区大小问题, 启动的时候带上分配大小参数就行了
emulator: WARNING: system partition size adjusted to match image file (1536 MB > 200 MB)
emulator: WARNING: data partition size adjusted to match image file (550 MB > 200 MB)
解决如下 (3000 单位是 M, 如果你那边提示需要更大, 那么就分配更多就行了)
emulator -partition-size 3000
时区问题
时区问题, 未解决(那位大神知道咋搞, 评论留一下呗)
我这边 etc/localtime 指向的是 /private/var/db/timezone/tz/2019a.1.0/zoneinfo/Asia/Shanghai ( 为啥只有上海, 没有北京??? )
但是 /usr/share/zoneinfo/ 也是一个快捷方式而已, 也是 link 到 /private/var/db/timezone/tz/2019a.1.0/zoneinfo
emulator: ### WARNING: /etc/localtime does not point to /usr/share/zoneinfo/, can't determine zoneinfo timezone name
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)