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
Building aosp
PDF
A deep dive into Android OpenSource Project(AOSP)
PDF
Embedded Android : System Development - Part I
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PDF
Low Level View of Android System Architecture
PDF
Android Treble: Blessing or Trouble?
PDF
Embedded Android Workshop with Pie
Building aosp
A deep dive into Android OpenSource Project(AOSP)
Embedded Android : System Development - Part I
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Low Level View of Android System Architecture
Android Treble: Blessing or Trouble?
Embedded Android Workshop with Pie

What's hot (20)

PPT
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
PDF
Android Boot Time Optimization
PPT
Learning AOSP - Android Linux Device Driver
PDF
Android Basic Components
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PDF
Android OTA updates
ODP
Embedded Android : System Development - Part III
PDF
Android Automotive
PDF
Android's HIDL: Treble in the HAL
PPT
Android booting sequece and setup and debugging
PDF
Android Internals
PDF
Booting Android: bootloaders, fastboot and boot images
PDF
Embedded Android : System Development - Part II (HAL)
PDF
Embedded Android : System Development - Part IV (Android System Services)
PDF
Embedded Android : System Development - Part IV
PPTX
Introduction to iOS Apps Development
PPTX
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
PDF
Android Internals
PPTX
Basic android-ppt
PDF
Android IPC Mechanism
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Android Boot Time Optimization
Learning AOSP - Android Linux Device Driver
Android Basic Components
Embedded Android : System Development - Part II (Linux device drivers)
Android OTA updates
Embedded Android : System Development - Part III
Android Automotive
Android's HIDL: Treble in the HAL
Android booting sequece and setup and debugging
Android Internals
Booting Android: bootloaders, fastboot and boot images
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV
Introduction to iOS Apps Development
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android Internals
Basic android-ppt
Android IPC Mechanism
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)
PPT
Learning AOSP - Android Booting Process
PPTX
Content provider in_android
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)
Learning AOSP - Android Booting Process
Content provider in_android
Ad

Similar to Deep Dive into the AOSP (20)

PDF
Docker module 1
PPTX
ASP.NET 5 auf Raspberry PI & docker
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
Deploying to Ubuntu on Linode
PPTX
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
PDF
The development environment
PDF
Deliver Python Apps with Docker
PDF
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
ODP
Android porting for dummies @droidconin 2011
PDF
Windows container security
PPTX
Reactive summit 2020 microsoft orleans the easy way
PPTX
Core os dna_oscon
PDF
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
PDF
24HOP Introduction to Linux for SQL Server DBAs
PPTX
Building an iOS Build Server
PDF
yocto_scale_handout-with-notes
PPTX
Rhodes mobile Framework
PDF
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
PDF
Dockerizing Oracle Database
PPTX
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Docker module 1
ASP.NET 5 auf Raspberry PI & docker
Dependencies Managers in C/C++. Using stdcpp 2014
Deploying to Ubuntu on Linode
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
The development environment
Deliver Python Apps with Docker
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Android porting for dummies @droidconin 2011
Windows container security
Reactive summit 2020 microsoft orleans the easy way
Core os dna_oscon
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
24HOP Introduction to Linux for SQL Server DBAs
Building an iOS Build Server
yocto_scale_handout-with-notes
Rhodes mobile Framework
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Dockerizing Oracle Database
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
Modernizing your data center with Dell and AMD
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Review of recent advances in non-invasive hemoglobin estimation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Modernizing your data center with Dell and AMD
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Chapter 2 Digital Image Fundamentals.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Review of recent advances in non-invasive hemoglobin estimation

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