[UTILITY][1/8] Build CM10.1 or AOKP on OS X - OS X Build Set Up 1.2

Search This thread

frostincredible

Retired Recognized Developer
Nov 21, 2010
602
160
Florida
OS X Build Set Up 1.2 - By Kyle Frost (frostincredible)

So you want to build AOKP or CM10.1 on OS X? Well worry no longer my friends,
it is about to get a whole lot easier. Why is that? Because this script I've written will do pretty
much everything for you, from creating the case sensitive DMG to installing the required files,
to setting up all the folders. The best part? It also will initialize the AOKP or CM repo (depending
on your choice) and you can also build them straight from the script! How fantastic is that?!
Simply read on to see how! Make sure to follow all the instructions (there aren't many)!

Follow these steps:

  1. Go here and download OS X Build Set Up 1.2 (OSX_Setup-1.2.zip) - DOWNLOAD
  2. Place the ZIP file on your Desktop.
  3. Extract the ZIP to your Desktop.
  4. Here comes the only tricky part. Open the file located at OSX_Setup/scripts/advanced_scripts/build_cm or build_aokp, whichever you're going to build.
  5. Find this line -
    Code:
    # BELOW IS THE ONLY LINE YOU SHOULD BE EDITING. REPLACE *YOUR DEVICE* WHITH YOUR DEVICE'S CODE NAME. EX - NEXUS 7 = "grouper"
  6. Just below that, edit this line with the instructions in the one I just posted -
    Code:
    cp /Volumes/Android/OUT/target/product/*YOUR DEVICE*/aokp_*YOUR DEVICE*-ota-eng.$ME.zip /Volumes/Android/Builds/AOKP_$ME.$NOW.zip
  7. IT IS IMPORTANT THAT YOU DON'T EDIT ANYTHING ELSE.
  8. Open your favorite Terminal application (the default on is Terminal located at /Applications/Utilities/Terminal).
  9. cd to the OSX_Setup folder on your Desktop.
    Code:
    cd /Users/YOUR NAME/OSX_Setup
  10. Run the following -
    Code:
    ./runme
  11. After running this, you will be presented with the following menu -
    Code:
    ============================================================
            OS X Build Set Up 1.2 - by Kyle Frost
    ============================================================
    
                         ---Main Menu---
    
      1 - Create DMG
      2 - Install required files (MUST install MacPorts first)
             MacPorts available free at www.macports.org
      3 - Set up folders
    
      WARNING: DO NOT RUN ADVANCED MENU UNTIL
      YOU HAVE RUN ALL 3 ABOVE, OR HAVE DONE
      THEM ALL MANUALLY. THANK YOU.
    
      0 - Advanced Menu
    
      x - Exit
    
    Enter option:
  12. As you can see, you need to go here and install MacPorts before proceeding - MacPorts
  13. After installing MacPorts you can go ahead and run everything.
  14. Create DMG will give you the options of creating a 25GB, 30GB, 40GB, 50GB, or 60GB DMG. 25GB is the lowest recommended by the Android Team.
  15. Install required files will simply do just that, it will install the files needed as specified in the AOSP documents. This can take a while, so go take a nap while it runs.
  16. Set up folders will give you the option of setting up the folders for AOKP or CM10.1. Simply choose which you want and the folders will be created.
  17. Choosing Advanced Menu will give you this -
    Code:
    ============================================================
            OS X Build Set Up 1.2 - by Kyle Frost
    ============================================================
    
                        ---Advanced Menu---
    
                MUST INSTALL XCODE BEFORE BUILDING!
                XCODE IS FREE IN THE MAC APP STORE!
    
      1 - Initialize AOKP Repo
      2 - Initialize CM10.1 Repo
    
      When building, it will give you a list
      of devices. Enter the number for your device
      configuration and the build will continue.
      It will take a while the first time, as the
      source must first completely download.
    
      3 - Build AOKP
      4 - Build CM10.1
    
      Note: When the build is complete, you can
            find the finished ZIP in the Builds
            folder on your Android disk image.
    
      0 - Go to Main Menu
    
    Enter option:
  18. There you can see you need to install Xcode, if you haven't already. It is free in the Mac App Store (this script is for OS X, you know).
  19. All the options are pretty self explanatory. Make sure you have run the folder set up for the ROM which you wish to build first. Run the initialize option for your desired ROM before running the build option.
  20. That is it! After the build has done (takes a while the first time you set all this up, much faster the next few times) you will be able to build your own nightly's, or whatever you so desire! Have fun!

NOTE: If you have an error regarding "Xcode" and the "10.6 SDK" when trying to build, download the MacOSX10.6.sdk.zip, decompress it, and place it in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/".

Disclaimer: This will only work with devices that are officially supported by AOKP or CM10.1. If your device is not supported by their official repos, either wait to see if it is, try to edit my script to get the repo your device's tree is on, or wait until I get around to writing a tutorial on how to add custom repos.



Please do not redistribute this without my permission,
and feel free to hit that thanks button if you liked this.
 
Last edited:

grad061980

Senior Member
Dec 28, 2010
166
47
What Mac OS version is this for?

This is sweet and appreciated. I can't wait to try this tonight.Thanks for the script and tutorial.

What Mac OS X is this for? I assume Mountain Lion. I'm run 10.8.2 at work and thinking about updating my home computer to the same. I have a build environment setup for OS X 10.6.8 at home, but Mac Ports was giving me issues and this will help me in getting my build environment back up and going. Thanks again.
 

sonymsam

Senior Member
Sep 12, 2008
211
50
Houston
I have mountain Lion, will it work on it? I am surely gonna give it a try when i get home! I was thinking on installing ubuntu. but nahh!:D
 

emd2009

Senior Member
Jun 3, 2007
739
91
I unfortunately do not own a fast enough computer can someone build aokp for xoom?
 

wildestpixel

Senior Member
Aug 25, 2011
1,016
548
London

frostincredible

Retired Recognized Developer
Nov 21, 2010
602
160
Florida
This is sweet and appreciated. I can't wait to try this tonight.Thanks for the script and tutorial.

What Mac OS X is this for? I assume Mountain Lion. I'm run 10.8.2 at work and thinking about updating my home computer to the same. I have a build environment setup for OS X 10.6.8 at home, but Mac Ports was giving me issues and this will help me in getting my build environment back up and going. Thanks again.

I'm running OS X 10.8.2 and that's what I build on.

I have mountain Lion, will it work on it? I am surely gonna give it a try when i get home! I was thinking on installing ubuntu. but nahh!:D

Mountain Lion should be fine. :) I run 10.8.2

Make sure you mount the sparse image before trying to install the folders ;)

Did you have to? Mounting should be a part of the script. I will look into that.

Which Version of xCode is requirement? (4.4, 4.0 or a older Version)

I have the developer beta, but the newest in the App Store should work fine.
 
  • Like
Reactions: drago34

ahpatel

Senior Member
Oct 2, 2010
159
52
Thanks for making this easy! Is there a way to leverage this to also cherrypick patches or revert official merges that don't work well for me?
 
Last edited:

frostincredible

Retired Recognized Developer
Nov 21, 2010
602
160
Florida
  • Like
Reactions: drago34
G

GuestK00156

Guest
Fantastic tutorial. Cant wait to figure out how to compile AOKP for my unsupported i777.
 
G

GuestK00156

Guest
i screwed up and mistakenly ejected the Android DMG and it won't let me create a new one,,,,what should i do?

Remount it. It is located in your home directory.

---------- Post added at 07:54 PM ---------- Previous post was at 07:38 PM ----------

Trying to compile for the SGS2 i777 and I get the following error:

Code:
---This is where you choose your device config---

You're building on Darwin
  (ohai, koush!)

Lunch menu... pick a combo:
     1. full-eng
     2. full_x86-eng
     3. vbox_x86-eng
     4. full_mips-eng
     5. mini_armv7a_neon-userdebug
     6. mini_armv7a-userdebug
     7. mini_mips-userdebug
     8. mini_x86-userdebug
     9. full_panda-userdebug

Which would you like? [full-eng] 6
build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.
Device armv7a not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for armv7a not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.

** Don't have a product spec for: 'mini_armv7a'
** Do you have the right repo manifest?


build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.

cp: /Volumes/Android/OUT/target/product/i777/cm_i777-ota-eng.xxxxxxx.zip: No such file or directory

Followed the instructions to the letter, but Im not sure whats wrong.
 

wildestpixel

Senior Member
Aug 25, 2011
1,016
548
London
Remount it. It is located in your home directory.

---------- Post added at 07:54 PM ---------- Previous post was at 07:38 PM ----------

Trying to compile for the SGS2 i777 and I get the following error:

Code:
---This is where you choose your device config---

You're building on Darwin
  (ohai, koush!)

Lunch menu... pick a combo:
     1. full-eng
     2. full_x86-eng
     3. vbox_x86-eng
     4. full_mips-eng
     5. mini_armv7a_neon-userdebug
     6. mini_armv7a-userdebug
     7. mini_mips-userdebug
     8. mini_x86-userdebug
     9. full_panda-userdebug

Which would you like? [full-eng] 6
build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.
Device armv7a not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for armv7a not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.

** Don't have a product spec for: 'mini_armv7a'
** Do you have the right repo manifest?


build/core/combo/HOST_darwin-x86.mk:62: *****************************************************
build/core/combo/HOST_darwin-x86.mk:63: * Cannot find SDK 10.6 at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
build/core/combo/HOST_darwin-x86.mk:65: * If you wish to build using higher version of SDK, 
build/core/combo/HOST_darwin-x86.mk:66: * try setting BUILD_MAC_SDK_EXPERIMENTAL=1 before 
build/core/combo/HOST_darwin-x86.mk:67: * rerunning this command 
build/core/combo/HOST_darwin-x86.mk:69: *****************************************************
build/core/combo/HOST_darwin-x86.mk:70: *** Stop..  Stop.

cp: /Volumes/Android/OUT/target/product/i777/cm_i777-ota-eng.xxxxxxx.zip: No such file or directory

Followed the instructions to the letter, but Im not sure whats wrong.

Same here compiling for grouper and tried 5 and 6.
 
D

DinoSoup

Guest
It would appear that I've completely screwed it up. After creating a twenty-five gig partition, I began to try to build, and was met with an error about Xcode. I fix it, and continued. However, I ended up deleting the created partition through Disk Image. Whenever I try using the program to create another, it says one already exists (which it doesn't). I don't know what to do now.
 
Last edited by a moderator:
G

GuestK00156

Guest
It would appear that I've completely screwed it up. After creating a twenty-five gig partition, I began to try to build, and was met with an error about Xcode. I fix it, and continued. However, I ended up deleting the created partition through Disk Image. Whenever I try using the program to create another, it says one already exists (which it doesn't). I don't know what to do now.

You could try:

Code:
rm -f ~/Android.dmg.sparseimage

then try recreating it through the app.
Disclaimer: This is undoable and use it at your own risk.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    OS X Build Set Up 1.2 - By Kyle Frost (frostincredible)

    So you want to build AOKP or CM10.1 on OS X? Well worry no longer my friends,
    it is about to get a whole lot easier. Why is that? Because this script I've written will do pretty
    much everything for you, from creating the case sensitive DMG to installing the required files,
    to setting up all the folders. The best part? It also will initialize the AOKP or CM repo (depending
    on your choice) and you can also build them straight from the script! How fantastic is that?!
    Simply read on to see how! Make sure to follow all the instructions (there aren't many)!

    Follow these steps:

    1. Go here and download OS X Build Set Up 1.2 (OSX_Setup-1.2.zip) - DOWNLOAD
    2. Place the ZIP file on your Desktop.
    3. Extract the ZIP to your Desktop.
    4. Here comes the only tricky part. Open the file located at OSX_Setup/scripts/advanced_scripts/build_cm or build_aokp, whichever you're going to build.
    5. Find this line -
      Code:
      # BELOW IS THE ONLY LINE YOU SHOULD BE EDITING. REPLACE *YOUR DEVICE* WHITH YOUR DEVICE'S CODE NAME. EX - NEXUS 7 = "grouper"
    6. Just below that, edit this line with the instructions in the one I just posted -
      Code:
      cp /Volumes/Android/OUT/target/product/*YOUR DEVICE*/aokp_*YOUR DEVICE*-ota-eng.$ME.zip /Volumes/Android/Builds/AOKP_$ME.$NOW.zip
    7. IT IS IMPORTANT THAT YOU DON'T EDIT ANYTHING ELSE.
    8. Open your favorite Terminal application (the default on is Terminal located at /Applications/Utilities/Terminal).
    9. cd to the OSX_Setup folder on your Desktop.
      Code:
      cd /Users/YOUR NAME/OSX_Setup
    10. Run the following -
      Code:
      ./runme
    11. After running this, you will be presented with the following menu -
      Code:
      ============================================================
              OS X Build Set Up 1.2 - by Kyle Frost
      ============================================================
      
                           ---Main Menu---
      
        1 - Create DMG
        2 - Install required files (MUST install MacPorts first)
               MacPorts available free at www.macports.org
        3 - Set up folders
      
        WARNING: DO NOT RUN ADVANCED MENU UNTIL
        YOU HAVE RUN ALL 3 ABOVE, OR HAVE DONE
        THEM ALL MANUALLY. THANK YOU.
      
        0 - Advanced Menu
      
        x - Exit
      
      Enter option:
    12. As you can see, you need to go here and install MacPorts before proceeding - MacPorts
    13. After installing MacPorts you can go ahead and run everything.
    14. Create DMG will give you the options of creating a 25GB, 30GB, 40GB, 50GB, or 60GB DMG. 25GB is the lowest recommended by the Android Team.
    15. Install required files will simply do just that, it will install the files needed as specified in the AOSP documents. This can take a while, so go take a nap while it runs.
    16. Set up folders will give you the option of setting up the folders for AOKP or CM10.1. Simply choose which you want and the folders will be created.
    17. Choosing Advanced Menu will give you this -
      Code:
      ============================================================
              OS X Build Set Up 1.2 - by Kyle Frost
      ============================================================
      
                          ---Advanced Menu---
      
                  MUST INSTALL XCODE BEFORE BUILDING!
                  XCODE IS FREE IN THE MAC APP STORE!
      
        1 - Initialize AOKP Repo
        2 - Initialize CM10.1 Repo
      
        When building, it will give you a list
        of devices. Enter the number for your device
        configuration and the build will continue.
        It will take a while the first time, as the
        source must first completely download.
      
        3 - Build AOKP
        4 - Build CM10.1
      
        Note: When the build is complete, you can
              find the finished ZIP in the Builds
              folder on your Android disk image.
      
        0 - Go to Main Menu
      
      Enter option:
    18. There you can see you need to install Xcode, if you haven't already. It is free in the Mac App Store (this script is for OS X, you know).
    19. All the options are pretty self explanatory. Make sure you have run the folder set up for the ROM which you wish to build first. Run the initialize option for your desired ROM before running the build option.
    20. That is it! After the build has done (takes a while the first time you set all this up, much faster the next few times) you will be able to build your own nightly's, or whatever you so desire! Have fun!

    NOTE: If you have an error regarding "Xcode" and the "10.6 SDK" when trying to build, download the MacOSX10.6.sdk.zip, decompress it, and place it in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/".

    Disclaimer: This will only work with devices that are officially supported by AOKP or CM10.1. If your device is not supported by their official repos, either wait to see if it is, try to edit my script to get the repo your device's tree is on, or wait until I get around to writing a tutorial on how to add custom repos.



    Please do not redistribute this without my permission,
    and feel free to hit that thanks button if you liked this.
    2
    Version 1.0 - Initial Release

    Version 1.1 - Bug Fixes

    Version 1.2 - Bug Fixes
    2
    Error in step 2 of main menu

    Hey,

    I am getting this error

    Code:
    Enter option: 2
    Warning: The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build.
    Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
    --->  Computing dependencies for gmakeError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?

    I have installed mac ports and xcode...and done step 1 (made the dmg...and its mounted)
    Dont exactly know what i am doing wrong..

    I am using a macbook pro running OS X 10.8

    Any help please
    Thanx
    1
    Reserved for future tips and tricks.
    1
    Hey,

    I am getting this error

    Code:
    Enter option: 2
    Warning: The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build.
    Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
    --->  Computing dependencies for gmakeError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?

    I have installed mac ports and xcode...and done step 1 (made the dmg...and its mounted)
    Dont exactly know what i am doing wrong..

    I am using a macbook pro running OS X 10.8

    Any help please
    Thanx

    Xcode Command Line Tools can be installed from Xcode Prefs, Downloads, Components.