挂载android分区
sudo hdiutil attach ~/android_code/android7.dmg.sparseimage -mountpoint /Volumes/android

原放入U盘:
echo '188jinghao' | sudo -S hdiutil attach ~/android7.dmg.sparseimage -mountpoint /Volumes/android

放入机械硬盘
sudo hdiutil attach /Volumes/chenjinghao/android7.dmg.sparseimage -mountpoint /Volumes/android7

sudo hdiutil attach /Volumes/chenjinghao/code/android.dmg.sparseimage -mountpoint /Volumes/android
tar -cvf android-6.0.1.tar /Volumes/android/android6_0_1/

启动模拟器

  1. export ANDROID_PRODUCT_OUT=/Volumes/android/android6.0.1/out/target/product/generic

  2. export ANDROID_PRODUCT_OUT_BIN=/Volumes/android/android6.0.1/out/host/linux-x86/bin

  3. export PATH=$PATH:$ANDROID_PRODUCT_OUT_BIN:$ANDROID_PRODUCT_OUT

  4. $cd ~/android/out/host/linux-x86/bin

  5. $ emulator -system system.img -data userdata.img -ramdisk ramdisk.img

  6. export ANDROID_BUILD_TOP=/Volumes/android/android6_0_1

  7. export ANDROID_PRODUCT_OUT=/Volumes/android/android6.0.1/out/target/product/generic

  8. export ANDROID_PRODUCT_OUT_BIN=/Volumes/android/android6.0.1/out/host/darwin-x86/bin

  9. export PATH=$PATH:$ANDROID_PRODUCT_OUT_BIN:$ANDROID_PRODUCT_OUT:$ANDROID_BUILD_TOP

  10. /Volumes/android/android6.0.1/out/host/linux-x86/bin/emulator

  11. -system /Volumes/android/android6.0.1/out/target/product/generic/system.img

  12. -data /Volumes/android/android6.0.1/out/target/product/generic/userdata.img

  13. -ramdisk /Volumes/android/android6.0.1/out/target/product/generic/ramdisk.img

启动模拟器
export ANDROID_BUILD_TOP=/Volumes/android/android7.1.1
export ANDROID_PRODUCT_OUT=/Volumes/android/android7.1.1/out/target/product/shamu
export ANDROID_PRODUCT_OUT_BIN=/Volumes/android/android7.1.1/out/host/darwin-x86/bin
export PATH=$PATH:$ANDROID_PRODUCT_OUT_BIN:$ANDROID_PRODUCT_OUT:$ANDROID_BUILD_TOP

emulator
-system /Volumes/android/android7.1.1/out/target/product/shamu/system.img
-data /Volumes/android/android7.1.1/out/target/product/shamu/userdata.img
-ramdisk /Volumes/android/android7.1.1/out/target/product/shamu/ramdisk.img

下载源码遇到的问题一:
这个error信息忘了详细记录了,就是某个./repo/projects/.............下面报错了,把报错的文件夹删掉,repo sync
error:
………………………………………………………………………...
Traceback (most recent call last):
File "/Volumes/aosp/android-6.0.1/.repo/repo/main.py", line 531, in
_Main(sys.argv[1:])
…………………………….
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd4 in position 578: ordinal not in range(128)
解决办法:根据error的提示,删除./repo/projects/...相应下的git就行了,然后再repo sync

编译源码遇到的问题二:
build/core/combo/mac_version.mk:39: * Can not find SDK 10.12 at /Developer/SDKs/MacOSX10.6.sdk
build/core/combo/mac_version.mk:40: *****************************************************
build/core/combo/mac_version.mk:41: *** Stop.. Stop.
配置mac_sdk_versions_supported里添加10.12

编译源码遇到的问题三:
system/core/libcutils/threads.c:38:10: error: 'syscall' is deprecated: first deprecated in OS X 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
return syscall(SYS_thread_selfid);
^
host C: libcutils <= system/core/libcutils/iosched_policy.c
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked deprecated here
int syscall(int, ...);
MacOSX-SDKs下载地址:https://github.com/phracker/MacOSX-SDKs
删除10.12,下载MacOSX10.11.sdk,解压拷贝到/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
然后确保AOSP源码下build/core/combo/mac_version.mk文件中
mac_sdk_versions_supported := 10.9 10.10 10.11
后面不要写10.12。

编译源码遇到的问题四:
找不到com.sun.javadoc.ClassDoc
external/doclava/src/com/google/doclava/ClassInfo.java:20:
error: package com.sun.javadoc does not exist import com.sun.javadoc.ClassDoc;external/doclava/src/com/google/doclava/apicheck/XmlApiFile.java:80:
error: cannot find symbol ClassDoc classDoc = null; ^
symbol: class ClassDoc location: class XmlApiFile Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 163 errors
make: *** [out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/javalib.jar] Error 41
在bash_profile里添加
export ANDROID_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home

nothing matches overlay file notification_bg_normal_pressed.9.png, for flavor hdpi-v19
nothing matches overlay file notification_bg_normal_pressed.9.png, for flavor xhdpi-v19
nothing matches overlay file notification_bg_normal_pressed.9.png, for flavor xxhdpi-v4
nothing matches overlay file notification_bg_normal_pressed.9.png, for flavor xxhdpi-v19
[ 99% 27238/27420] Compiling SDK Stubs...tubs_current_intermediates/classes.jar
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[ 99% 27413/27420] host Java: ahat-tes...RIES/ahat-tests_intermediates/classes)
注: art/tools/ahat/test/SortTest.java使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[100% 27420/27420] Checking build with...sts_intermediates/jack.check.timestamp

更多相关文章

  1. Android(安卓)com.android.support 版本不一致
  2. android gradle编译 多个flavor中加载不同的android library的fl
  3. android源码分析(一) - 语言切换机制
  4. 解读ExpandableListView源码样式
  5. Android(安卓)ROM研究---如何在ubuntu下下载姜饼(Gingerbread)源
  6. ANDROID Porting系列一、ANDROID编译系统
  7. 【Android(安卓)NDK 开发】Ubuntu 函数库交叉编译 ( Android(安
  8. Android内核源码交叉编译
  9. Android(安卓)源代码结构

随机推荐

  1. Android 工具
  2. 阿里Android开发手册读后感-上篇
  3. Android Jni中使用线程及回调更新UI
  4. 【Android】说做就做:都市列表+卫星地图
  5. android平台下基于OpenSL ES实现音频录制
  6. android adb介绍
  7. Android(安卓)Retrofit + RxJava + MVP +
  8. Android设置屏幕亮度的两种方式
  9. Android内存和外存的学习
  10. android, iOS app reverse enginnering