Pageviews

Tuesday, November 19, 2013

How to check a folder size for Mac OSX?

As the folder gets bigger, especially when I develop android source code, a project could easily go over a few gigabytes. In Mac OSX, the folder size showed is not always accurate. It sometimes can cause confusions in real development. 

A single command to update the folder size is:

          sudo du -h [path to folder]

It will not just print the actual size of the folder, but also updates info displayed in the property window.

As always, you are welcome.

How to effectively use repo and git for AOSP?

"Repo is a wrapper command line tool for Git."

Why repo? Because a AOSP source tree is huge and consists many projects, for example, framework/av is a project, hardware/qcom is another project.
Instead of git commit individual and then push to the remote server, Google team has implemented this Repo as a central commander which manages all git commit for all projects.


To be able to effectively working on AOSP. Once your downloaded your source tree using "repo sync"

1, go to home directory, in my case its at android/kitkat/

2, repo start [branch] [path to project]

I was confused about project paths, however there is a easy way to figure it out. As you "cd" through your source tree, if a sub folder contains a ".git" hidden file, then this sub folder is a project. The absolute path to this project is [path to project].

This makes sense because repo manages all git repositories and each git repository is a project.

[branch] name can be totally random.

To confirm what this command has done, find the .git directory, then do "git status", you should be able to find the [branch] name initialized by repo command.

3, After you modify the source code in a project. you should commit to local .git repository.
Using git commit -m 'COMMENTS'
You may push the modified source code to your public git profile.

for example, my git username is "fangboy" and I want to push project "media.git"

               git remote add origin https://github.com/fangboy/media.git 
               # Creates a remote named "origin" pointing at your GitHub repository

               git push origin [branch]
               # Sends your commits in the "master" branch to GitHub


As always, you are welcome.





Saturday, November 16, 2013

How to fix the upgrading repo issue and missing gnupg on Mac OSX Mavericks?

Google has recently updated its repo wrapper to version 1.12.7. I had a 1.12.4 repo, then when sync up my newest kitkat source tree using
              repo sync
The repo complains

  •  gpg: Can't check signature: public key not found
  • error: could not verify the tag 'v1.12.7'

The issue was that preinstalled gnup was not recognizable by default.
You may find a gnup binary under /usr/local/Cellar/
however, by default, repo will search for gpg at /usr/local/bin/
So to solve this missing gnupg issue, we should install a GPG suite.

Link here: https://gpgtools.org/

It will automatically install a gpg at /usr/local/bin/
Then you should be able to use repo sync to the latest version!

As always, you are welcome.

Saturday, November 9, 2013

How to Make a single module (shared library) for AOSP.

According to the AOSP homepage, we learned that we could build the whole aosp source tree using:
$: make -j4
the command will generate a /out directory for storing all compiled resources.

This command normally takes about 40mins - 1hr for compiling depends on the CPU.
but if you just want to modify a single library, ex a libOmxVdec.so which is used for decoding videos.

1, go to /hardware/qcom/media/mm-video/vidc/vdec/
    this is the source file that generates the libOmxVdec.so, you should be able to find a Android.mk file, open it up, you can find a line says:
                  LOCAL_MODULE := libOmxVdec
   basically, it tells the compile to generate a shared library named after this name.

2, to make this component and not the whole source tree, simply type:
$: mmm
please use command "hmm" for the help messages, basically this command tells the compiler to builds all of the modules in the supplied directories, but not their dependencies.
The generated .so file and other resources will be generated and get transferred to the corresponding location in /out directory.

*Sometimes, the compiler will complain there is nothing to make, that's because /out directly already have a existing .so file with the same name. to do the make clean for this specific component.
$: mmm -B

As always, you are welcome!