SlideShare a Scribd company logo
Deep Dive into the AOSP
Android Open Source Project
Dr. Ketan Parmar
Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd.
@kpbird
+ketanparmar
www.kpbird.com
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Android open source project
• Android is an open-source software stack for a wide range of mobile
devices and a corresponding open-source project led by Google
• It’s commonly referred as AOSP
• AOSP has 450+ projects
• www.source.android.com
• www.b.android.com
• https://android-review.googlesource.com/
Deep Dive into the AOSP
Deep Dive into the AOSP
Deep Dive into the AOSP
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Requirement
• Operating System: Linux (Ubuntu) or Mac
• Environment : 64 bit
• Disk Space for Source : 40 GB
• Disk Space for Build : 100 GB
• Software Requirements :
• Python 2.6 -- 2.7
• GNU Make 3.81 -- 3.82
• JDK 7
• Git 1.7 or newer
Repo, Gerrit, Manifest
• Repo is a repository management tool that google has built on top of
Git. Repo unifies the many Git repositories when necessary, does the
uploads to our revision control system.
• Gerrit is a web-based code review system for projects that use git.
Gerrit encourages more centralized use of Git by allowing all
authorized users to submit changes, which are automatically merged
if they pass code review
• Manifest – A manifest file is an XML file, describing a list of
repositories to sync our working directory with.
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Initializing a Build Environment
• Install JDK-7
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
• Required package for Ubuntu 14.x
$ sudo apt-get install bison g++-multilib git
gperf libxml2-utils
Install Repo
• Make sure you have a bin/ directory in your home directory and that
it is included in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
• Download the Repo tool and ensure that it is executable:
$ curl https://storage.googleapis.com/git-repo-
downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Initialization Repo Client
• Create an empty directory to hold your working files. If you're using
MacOS, this has to be on a case-sensitive filesystem. Give it any name
you like:
$ mkdir AOSP
$ cd AOSP
• Run repo “init” to bring down the latest version of Repo with all its
most recent bug fixes.
$ repo init -u
https://android.googlesource.com/platform/manife
st
Download Source Tree
• Download Source Tree
$ repo sync –j(--jobs)
• It will download almost 40 GB.
Deep Dive into the Source Tree
Deep Dive into the Source Tree
• Bionic - the C-runtime for Android. Note that Android is not using
glibc like most Linux distributions.
• Bootable - boot and startup related code.
• Build - the build system implementation including all the core make
file templates.
• Cts - the compatability tests. The test suite to ensure that a build
complies with the Android specification.
• Dalvik - the source code for the implementation of the Dalvik Virtual
Machine
Deep Dive into the Source Tree
• Development - projects related to development such as the source
code for the sdk and ndk tools
• Device - product specific code for different devices.
• External - contains source code for all external open source projects
such as SQLite, Freetype and webkit.
• Frameworks - this folder is essential to Android since it contains the
sources for the framework. Here you will find the implementation of
key services such as the System Server with the Package- and Activity
managers.
Deep Dive into the Source Tree
• Hardware - hardware related source code such as the Android
hardware abstraction layer specification and implementation.
• Out - the build output will be placed here after you run make.
• Packages - contains the source code for the default applications such
as contacts, calendar, browser.
• Prebuilt - contains files that are distributed in binary form for
convenience.
• System - source code files for the core Android system. That is the
minimal Linux system that is started before the Dalvik VM and any
java based services are enabled.
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Build for Device
Download Drivers for the Device
https://developers.google.com/android/nexus/drivers
Extract Drivers for the Device
Extract Drivers for the Device
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Build AOSP
• Initialize Build Environment
$ source build/envsetup.sh
or
$ . build/envsetup.sh
• Choose Target
$ lunch
Build AOSP
Build AOSP
• Choose Target
$ lunch
• Press 8 and enter
• Start build with make command
$ make -j4
Wait…….
Output
Understand AOSP
Requirement
Initializing a Build Environment
Download Source Tree
Download Device Drivers
Build AOSP
Install AOSP
Install AOSP Build in Nexus 5
fastboot oem unlock
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot reboot
Enjoy… You own build…
Repo Commands
sync
init
upload
diff
download
start
status
$repo help COMMAND
Helper functions
• croot: change directory to the top of the tree
• m: execute 'make' from the top of the tree
• mm - builds all of the modules in the current directory
• mmm <dir1>: build all of the modules in the supplied directories
• cgrep <pattern>: grep on all local C/C++ files
• jgrep <pattern>: grep on all local Java files
• resgrep <pattern>: grep on all local res/*.xml files
• godir <filename>: go to the directory containing a file
Dr. Ketan Parmar
Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd.
@kpbird
+ketanparmar
www.kpbird.com
Thank You

More Related Content

PDF
A deep dive into Android OpenSource Project(AOSP)
PDF
Embedded Android : System Development - Part I
PDF
Android Boot Time Optimization
PDF
Embedded Android Workshop with Pie
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PDF
Building aosp
PPT
Learning AOSP - Android Booting Process
PDF
Android's HIDL: Treble in the HAL
A deep dive into Android OpenSource Project(AOSP)
Embedded Android : System Development - Part I
Android Boot Time Optimization
Embedded Android Workshop with Pie
Embedded Android : System Development - Part II (Linux device drivers)
Building aosp
Learning AOSP - Android Booting Process
Android's HIDL: Treble in the HAL

What's hot (20)

PDF
Booting Android: bootloaders, fastboot and boot images
PDF
Android Binder IPC for Linux
PDF
Embedded Android : System Development - Part II (HAL)
PPT
Learning AOSP - Android Linux Device Driver
PDF
Aosp+
PDF
Android Things : Building Embedded Devices
PDF
Android Treble: Blessing or Trouble?
PPTX
Android Booting Sequence
ODP
Q4.11: Porting Android to new Platforms
ODP
Embedded Android : System Development - Part III
PDF
Embedded Android : System Development - Part IV
PPT
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
PDF
Android device driver structure introduction
PDF
Understanding the Android System Server
PDF
Low Level View of Android System Architecture
PPTX
Android AIDL Concept
PDF
Android OS Porting: Introduction
PDF
Project meeting: Android Graphics Architecture Overview
PPT
Android booting sequece and setup and debugging
PDF
Android for Embedded Linux Developers
Booting Android: bootloaders, fastboot and boot images
Android Binder IPC for Linux
Embedded Android : System Development - Part II (HAL)
Learning AOSP - Android Linux Device Driver
Aosp+
Android Things : Building Embedded Devices
Android Treble: Blessing or Trouble?
Android Booting Sequence
Q4.11: Porting Android to new Platforms
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IV
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Android device driver structure introduction
Understanding the Android System Server
Low Level View of Android System Architecture
Android AIDL Concept
Android OS Porting: Introduction
Project meeting: Android Graphics Architecture Overview
Android booting sequece and setup and debugging
Android for Embedded Linux Developers
Ad

Viewers also liked (20)

PDF
From Android NDK To AOSP
PDF
How to build rock solid apps & keep 100m+ users happy
PPTX
Battery Optimization for Android Apps - Devoxx14
PDF
A Deep Dive into Open Source Android Development
PPTX
Android content providers
PDF
Android Embedded - Einführung in Android als Embedded-Plattform
PDF
Android porting-on-embedded-platform v2-0633850602027036930
PPT
Content providers in Android
PDF
Embedded Android Market Development
PDF
Embedded Android Real-Time Streaming Optimization
PDF
Android Internals at Linaro Connect Asia 2013
PDF
Brillo / Weave Internals
PDF
Embedded Android Workshop with Marshmallow
PDF
The Third Network: LSO, SDN and NFV
PDF
Remote Management of Embedded Android Devices
PDF
Memory Management in Android
PDF
LAS16-400: Mini Conference 3 AOSP (Session 1)
PPTX
Content provider in_android
PDF
Embedded Android Workshop with Nougat
From Android NDK To AOSP
How to build rock solid apps & keep 100m+ users happy
Battery Optimization for Android Apps - Devoxx14
A Deep Dive into Open Source Android Development
Android content providers
Android Embedded - Einführung in Android als Embedded-Plattform
Android porting-on-embedded-platform v2-0633850602027036930
Content providers in Android
Embedded Android Market Development
Embedded Android Real-Time Streaming Optimization
Android Internals at Linaro Connect Asia 2013
Brillo / Weave Internals
Embedded Android Workshop with Marshmallow
The Third Network: LSO, SDN and NFV
Remote Management of Embedded Android Devices
Memory Management in Android
LAS16-400: Mini Conference 3 AOSP (Session 1)
Content provider in_android
Embedded Android Workshop with Nougat
Ad

Similar to Deep Dive into the AOSP (20)

PDF
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
PDF
Droidcon uk2012 androvm
PDF
Android open source project build system phi innovations - android summit 2015
PDF
Android Platform Debugging and Development at ABS 2014
PDF
Android Platform Debugging and Development at ELCE 2013
PDF
Android Platform Debugging and Development
ODP
Android porting for dummies @droidconin 2011
PDF
Working with the AOSP - Linaro Connect Asia 2013
PDF
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
PPTX
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
PDF
Android Platform Debugging and Development
PDF
Android Platform Debugging & Development
PDF
4. The Build System _ Embedded Android.pdf
PDF
Discover System Facilities inside Your Android Phone
PDF
Android Platform Debugging and Development
PDF
Hacking Android OS
PDF
Android Platform Debugging and Development
PPT
Enhancing and modifying_the_core_android_os
PDF
Android Platform Debugging and Development
PDF
Build Community Android Distribution and Ensure the Quality
Introduction to Android ROM cooking, part of my AnDevCon workshop (AnDevCon S...
Droidcon uk2012 androvm
Android open source project build system phi innovations - android summit 2015
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development
Android porting for dummies @droidconin 2011
Working with the AOSP - Linaro Connect Asia 2013
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
Android Platform Debugging and Development
Android Platform Debugging & Development
4. The Build System _ Embedded Android.pdf
Discover System Facilities inside Your Android Phone
Android Platform Debugging and Development
Hacking Android OS
Android Platform Debugging and Development
Enhancing and modifying_the_core_android_os
Android Platform Debugging and Development
Build Community Android Distribution and Ensure the Quality

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
NewMind AI Monthly Chronicles - July 2025
Electronic commerce courselecture one. Pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Chapter 3 Spatial Domain Image Processing.pdf

Deep Dive into the AOSP

  • 1. Deep Dive into the AOSP Android Open Source Project
  • 2. Dr. Ketan Parmar Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd. @kpbird +ketanparmar www.kpbird.com
  • 3. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 4. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 5. Android open source project • Android is an open-source software stack for a wide range of mobile devices and a corresponding open-source project led by Google • It’s commonly referred as AOSP • AOSP has 450+ projects • www.source.android.com • www.b.android.com • https://android-review.googlesource.com/
  • 9. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 10. Requirement • Operating System: Linux (Ubuntu) or Mac • Environment : 64 bit • Disk Space for Source : 40 GB • Disk Space for Build : 100 GB • Software Requirements : • Python 2.6 -- 2.7 • GNU Make 3.81 -- 3.82 • JDK 7 • Git 1.7 or newer
  • 11. Repo, Gerrit, Manifest • Repo is a repository management tool that google has built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system. • Gerrit is a web-based code review system for projects that use git. Gerrit encourages more centralized use of Git by allowing all authorized users to submit changes, which are automatically merged if they pass code review • Manifest – A manifest file is an XML file, describing a list of repositories to sync our working directory with.
  • 12. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 13. Initializing a Build Environment • Install JDK-7 $ sudo apt-get update $ sudo apt-get install openjdk-7-jdk • Required package for Ubuntu 14.x $ sudo apt-get install bison g++-multilib git gperf libxml2-utils
  • 14. Install Repo • Make sure you have a bin/ directory in your home directory and that it is included in your path: $ mkdir ~/bin $ PATH=~/bin:$PATH • Download the Repo tool and ensure that it is executable: $ curl https://storage.googleapis.com/git-repo- downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo
  • 15. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 16. Initialization Repo Client • Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like: $ mkdir AOSP $ cd AOSP • Run repo “init” to bring down the latest version of Repo with all its most recent bug fixes. $ repo init -u https://android.googlesource.com/platform/manife st
  • 17. Download Source Tree • Download Source Tree $ repo sync –j(--jobs) • It will download almost 40 GB.
  • 18. Deep Dive into the Source Tree
  • 19. Deep Dive into the Source Tree • Bionic - the C-runtime for Android. Note that Android is not using glibc like most Linux distributions. • Bootable - boot and startup related code. • Build - the build system implementation including all the core make file templates. • Cts - the compatability tests. The test suite to ensure that a build complies with the Android specification. • Dalvik - the source code for the implementation of the Dalvik Virtual Machine
  • 20. Deep Dive into the Source Tree • Development - projects related to development such as the source code for the sdk and ndk tools • Device - product specific code for different devices. • External - contains source code for all external open source projects such as SQLite, Freetype and webkit. • Frameworks - this folder is essential to Android since it contains the sources for the framework. Here you will find the implementation of key services such as the System Server with the Package- and Activity managers.
  • 21. Deep Dive into the Source Tree • Hardware - hardware related source code such as the Android hardware abstraction layer specification and implementation. • Out - the build output will be placed here after you run make. • Packages - contains the source code for the default applications such as contacts, calendar, browser. • Prebuilt - contains files that are distributed in binary form for convenience. • System - source code files for the core Android system. That is the minimal Linux system that is started before the Dalvik VM and any java based services are enabled.
  • 22. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 24. Download Drivers for the Device https://developers.google.com/android/nexus/drivers
  • 25. Extract Drivers for the Device
  • 26. Extract Drivers for the Device
  • 27. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 28. Build AOSP • Initialize Build Environment $ source build/envsetup.sh or $ . build/envsetup.sh • Choose Target $ lunch
  • 30. Build AOSP • Choose Target $ lunch • Press 8 and enter • Start build with make command $ make -j4
  • 33. Understand AOSP Requirement Initializing a Build Environment Download Source Tree Download Device Drivers Build AOSP Install AOSP
  • 34. Install AOSP Build in Nexus 5 fastboot oem unlock fastboot flash recovery recovery.img fastboot flash boot boot.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot flash system system.img fastboot reboot
  • 35. Enjoy… You own build…
  • 37. Helper functions • croot: change directory to the top of the tree • m: execute 'make' from the top of the tree • mm - builds all of the modules in the current directory • mmm <dir1>: build all of the modules in the supplied directories • cgrep <pattern>: grep on all local C/C++ files • jgrep <pattern>: grep on all local Java files • resgrep <pattern>: grep on all local res/*.xml files • godir <filename>: go to the directory containing a file
  • 38. Dr. Ketan Parmar Sr. Tech Lead – InfoStretch Solutions Pvt. Ltd. @kpbird +ketanparmar www.kpbird.com Thank You