首页 > 系统服务 > 详细

Setting up a Mac OS build environment

时间:2015-05-26 12:02:48      阅读:353      评论:0      收藏:0      [点我收藏+]

  In a default installation, Mac OS runs on a case-preserving but case-insensitive filesystem. This type of filesystem is not supported by git and will cause some git commands (such as git status) to behave abnormally. Because of this, we recommend that you always work with the AOSP source files on a case-sensitive filesystem. This can be done fairly easily using a disk image, discussed below.

  Once the proper filesystem is available, building the master branch in a modern Mac OS environment is very straightforward. Earlier branches, including ICS, require some additional tools and SDKs.

  Creating a case-sensitive disk image

  You can create a case-sensitive filesystem within your existing Mac OS environment using a disk image. To create the image, launch Disk Utility and select "New Image". A size of 25GB is the minimum to complete the build; larger numbers are more future-proof. Using sparse images saves space while allowing to grow later as the need arises. Be sure to select "case sensitive, journaled" as the volume format.

  You can also create it from a shell with the following command:

 hdiutil create -type SPARSE -fs Case-sensitive Journaled HFS+ -size 40g ~/android.dmg

  This will create a .dmg (or possibly a .dmg.sparsefile) file which, once mounted, acts as a drive with the required formatting for Android development.

  If you need a larger volume later, you can also resize the sparse image with the following command:

hdiutil resize -size <new-size-you-want>g ~/android.dmg.sparseimage

For a disk image named android.dmg stored in your home directory, you can add helper functions to your~/.bash_profile:

  • To mount the image when you execute mountAndroid:
    mount the android file image
    function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }

    Note: If your system created a .dmg.sparsefile file, replace ~/android.dmg with~/android.dmg.sparsefile.

  • To unmount it when you execute umountAndroid:
    unmount the android file image
    function umountAndroid() { hdiutil detach /Volumes/android; }

  Once you‘ve mounted the android volume, you‘ll do all your work there. You can eject it (unmount it) just like you would with an external drive.

Setting up a Mac OS build environment

原文:http://www.cnblogs.com/solo-heart/p/4529967.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!