Android OS Forum banner
1 - 20 of 134 Posts

·
Android Apprentice
Joined
·
81 Posts
First of all thanks to ArmanUV for the guide format and Birdman for the advice and CM for the commits.

DISCLAIMER: I AM NOT RESPONSIBLE FOR ANYTHING THAT HAPPENS TO YOU WHILE FOLLOWING THIS GUIDE BUT I HAVE FOLLOWED IT MYSELF AND AM ALIVE AND WELL!!

Instructions:

First you need to go to the App Store and download Xcode 4. Once that is installed, open it up and go to preferences. Now click on the "Downloads" tab and then next to where it says "Command Line Tools" click install. That'll will take a few minutes.

Also you want to make sure you have android-sdk downloaded and installed and have it placed in /usr/local/ and make sure adb and fastboot work.


Open up the terminal and type:
Code:
<br />
java<br />
Install homebrew (note: technically you could use MacPorts to achieve the same thing, but I used homebrew):
Code:
<br />
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL [URL=https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew]https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew[/URL].rb)"<br />
Now make sure android-sdk and homebrew are in $PATH
Code:
<br />
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile<br />
Now run this and see if you need to update anything.
Code:
<br />
brew doctor<br />
If you do (and you probably will once a day) type:
Code:
<br />
brew update<br />
Now we need to get our dev packages
Code:
<br />
brew install git coreutils findutils gnu-sed gnupg pngcrush repo<br />
Once that is done, run
Code:
 brew outdated
if it shows anything, run
Code:
 brew upgrade
Now run this the correct a few symlinks [While it may not be needed anymore, I did it and I know AOKP builds after what I did]:
Code:
<br />
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed<br />
Now to create our case sensitive image for our AOKP work [NOTE: the 60g can be changed to anything. It only takes up what it needs but I used 60GB]:
Code:
<br />
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android<br />
Now to create our working directory
Code:
<br />
cd /Volumes/android && mkdir aokp && cd aokp<br />
Now to initialize the git and to download it [NOTE: 'say finished' is just for funzies and your mac will actually say finished when it is done. if you take it off, it'll just end and not tell you.]:
Code:
<br />
repo init -u [URL=git://github.com/AOKP/platform_manifest.git]git://github.com/AOKP/platform_manifest.git[/URL] -b jb && repo sync && say 'finished'<br />
Now just sit back and wait because, depending on your internet connection it can take a long time.

[UPDATE: According to ProTekk, those cherry-picks below have been merged. So repo sync and you should be able to build off the bat :) Let me know if somethings goes wrong.

Now, some are reporting that AOKP will build now and doesn't need any extra steps on Mountain Lion. However there are some (myself included) that received emulator errors while trying to build.

Luckily, there are two things we can do to fix this.

One is cherry-pick from CM (until it get's merged with AOKP):
Code:
<br />
cd /volumes/android/aokp/sdk/emulator/opengl/tests/translator_tests && git fetch [URL=http://review.cyanogenmod.com/CyanogenMod/android_sdk]http://review.cyanogenmod.com/CyanogenMod/android_sdk[/URL] refs/changes/87/19487/1 && git cherry-pick FETCH_HEAD<br />
and the other is:
Code:
<br />
cd /Volumes/android/aokp/external/qemu && nano Makefile.android<br />
Now where ever there is lines of code, add a # to the beginning of it. After you have done that, hit CTRL-X, it will ask you if you want to keep modified changes and you hit "Y".


After that you just build below. Remember if you cherry-pick, once you repo sync again, it will discard the pick so you need to redo it after each repo sync.

NOW we are ready to build [NOTE: toro is vzw galaxy nexus. for other supported devices, replace 'toro' with it's name (ie maguro)]:
Code:
<br />
. build/envsetup.sh && brunch toro<br />
And you're done. I know this seems round about way to do things, but if you just can't wait on some nightlies for your device, this is a way to do it on the OSX 10.8 operating system.

-Cheers and hopefully everything works for y'all and there are no typos :)
 

·
Android Apprentice
Joined
·
81 Posts
Discussion Starter · #5 ·
Also, I had you guys cherry picking to the wrong directory. It's updated now. Sorry. If you are having build errors, that is why.

Repo sync to get rid of any and then go back to that step if you need to.
 

·
Android Apprentice
Joined
·
81 Posts
Discussion Starter · #6 ·
I know this is noobish. and I've never owned a Mac until a couple days ago and I don't have a usr/local/bin directory just usr/bin

Edit: Nvm I got the directory after installing homebrew
The way I navigate to directories like that is to go up in finder to 'Go' and then 'Go To Folder' or SHFT-CMD-G :)
 

·
Codemonkey In Training
Joined
·
276 Posts
Does this guide work on 10.6.8? I know it says its for 10.8 but, I mean, how different could they really be? Will it destroy my computer if I try it or start a nuclear war or something?
 

·
Android Apprentice
Joined
·
81 Posts
Discussion Starter · #8 ·
Does this guide work on 10.6.8? I know it says its for 10.8 but, I mean, how different could they really be? Will it destroy my computer if I try it or start a nuclear war or something?
No, it should be fine. In fact you should be able to go from repo sync to building. Without the need of cherry-picking or any of that.
 

·
Android Apprentice
Joined
·
81 Posts
Discussion Starter · #14 ·
Sorry if this is too simple of a question, but I can not seem to find /usr on my Mac. I just switched to Mac a couple weeks ago and I want to compile for my toro.
Go in Finder to the Go at the top of the screen and then at the bottom Go To.. then type in /usr/ and hit enter

No noob questions when switching to Mac :)
 

·
failure at life
Joined
·
67 Posts
Sorry if this is too simple of a question, but I can not seem to find /usr on my Mac. I just switched to Mac a couple weeks ago and I want to compile for my toro.
Hey, another option is to simply toggle the 'hidden' attribute flag for /usr/

Open Terminal.app and enter:

Code:
sudo chflags nohidden /usr/
(this will ask for your password)

And now you'll always see the /usr/ directory in the root of your drive (well, sometimes os updates will reset the hidden flag, just run it again after any update that does.)

Cheers :)
 
1 - 20 of 134 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top