Monday, February 02, 2009
Getting and building Google Android from the source code on Mac OS X
Install XCode version 3.0, available from http://developer.apple.com/technology/tools.html.
Install MacPorts, available from http://svn.macports.org/repository/macports/downloads/MacPorts-1.7.0/
Open up a terminal, check /opt/local/bin is at the start of $PATH, and run
Installing repo
Go back to your home directory:
What I did:
After a little huff-n-puff, it'll ask for a name and email. The name should be real, as it'll be used for attributions, and the email address needs to be to a Google account. This doesn't have to be a Gmail address, but that's easiest.
Now you can get the files:
Now, finally you can:
Another chance for several more cups of coffee. Lots of warning messages fly by on the terminal that don't really mean that much.
You can see if it works by dragging the newly built emulator to a terminal window:
which should illicit the response:
Install MacPorts, available from http://svn.macports.org/repository/macports/downloads/MacPorts-1.7.0/
Open up a terminal, check /opt/local/bin is at the start of $PATH, and run
sudo port selfupdateHopefully it'll say something like:
Password:Get these packages from port, with the following command:
MacPorts base version 1.700 installed
Downloaded MacPorts base version 1.700
The MacPorts installation is not outdated so it was not updated
POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupgGo make a cup of coffee, or two, as several minutes will pass, depending on your machine and download speeds, and several terminal screens full of build comments will scroll slowly by.
Installing repo
Go back to your home directory:
cd ~If you don't already have one make a bin folder:
mkdir binMake sure it's on the path:
export PATH=/Users/threaded/bin:$PATHDownload the repo script:
echo $PATH
curl http://android.git.kernel.org/repo >~/bin/repoLook to see if it is executable:
ls -al ~/bin/repoMost probably it isn't so:
chmod a+x ~/bin/repoTo build the Android files you're recommended to use a case-sensitive Journaled HFS+. If you don't want to go creating a partition, formatting it, all the other ball-n-chain, you can, on the Mac, create a disk image. It is recommend to be 8 GB, but more won't harm.
What I did:
- launch /Applications/Utilities/Disk Utility
- select "New Image"
- Save As: mydroid (in my home directory)
- Volume Name: mydroid
- Volume Size: 16 GB (had to do this a couple of times before it 'took')
- Volume Format: Mac OS extended (Case-sensitive, Journaled)
- Encryption: none
- Partitions: single partition - Apple Partition
- Image Format: read/write disk image
cd /Volumes/mydroidRun repo init to get the files:
repo init -u git://android.git.kernel.org/platform/manifest.gitIf you get a permission denied, then you've forgotten to do the chmod to repo mentioned above, like I did. ;-)
After a little huff-n-puff, it'll ask for a name and email. The name should be real, as it'll be used for attributions, and the email address needs to be to a Google account. This doesn't have to be a Gmail address, but that's easiest.
Now you can get the files:
repo syncAgain this is long-winded, so there's time for yet another coffee.
Now, finally you can:
makeIf you get:
build/core/main.mk:64: ************************************************************That'll be because you are not where you think you are, but should rather be inside a Case-Sensitive, Journaled file system. ;-)
build/core/main.mk:65: You are building on a case-insensitive filesystem.
build/core/main.mk:66: Please move your source tree to a case-sensitive filesystem.
build/core/main.mk:67: ************************************************************
build/core/main.mk:68: *** Case-insensitive filesystems not supported. Stop.
Another chance for several more cups of coffee. Lots of warning messages fly by on the terminal that don't really mean that much.
You can see if it works by dragging the newly built emulator to a terminal window:
Volumes/mydroid/out/host/darwin-x86/bin/emulator
which should illicit the response:
emulator: ERROR: You did not specify a virtual machine name, and the system
directory could not be found.
If you are an Android SDK user, please use '@' or '-vm '
to start a given virtual machine (see -help-vm for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator
Labels: google android
Comments:
<< Home
I get an error "repo: command not found" on running the following script - repo init -u git://android.git.kernel.org/platform/manifest.git
Have a look at your path: the user's bin directory is probably not there. So write ./bin/repo instead.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home
Subscribe to Posts [Atom]