zoukankan      html  css  js  c++  java
  • Setting up a Mac OS build environment

      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.

  • 相关阅读:
    LeetCode: Reverse Linked List
    DataBase: MySQL在.NET中的应用
    DataBase: LeetCode
    DirectShow+VS2010+Win7配置说明
    MathType应用:批量改变公式格式
    $LaTeX$笔记:首字下沉
    Latex学习笔记-序
    反思--技术博客的写作应该是怎样的?
    用Latex写学术论文:作者(Author)&摘要(Abstract)
    用Latex写学术论文: IEEE Latex模板和文档设置(documentclass)
  • 原文地址:https://www.cnblogs.com/solo-heart/p/4529967.html
Copyright © 2011-2022 走看看