码迷,mamicode.com
首页 > 系统相关 > 详细

Setting up a Mac OS build environment

时间:2015-05-26 12:05:19      阅读:525      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!