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

What's hot (20)

PDF
Low Level View of Android System Architecture
National Cheng Kung University
 
PDF
Android device driver structure introduction
William Liang
 
PPT
Android booting sequece and setup and debugging
Utkarsh Mankad
 
PDF
Android Internals
Opersys inc.
 
PDF
Uboot startup sequence
Houcheng Lin
 
PDF
Android's HIDL: Treble in the HAL
Opersys inc.
 
PDF
Embedded Android : System Development - Part II (HAL)
Emertxe Information Technologies Pvt Ltd
 
PDF
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
PDF
Embedded Android Workshop
Opersys inc.
 
PPTX
Overview of Android binder IPC implementation
Chethan Pchethan
 
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 
PDF
Linux Porting
Champ Yen
 
PDF
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
PDF
Android OTA updates
Gary Bisson
 
ODP
Q4.11: Porting Android to new Platforms
Linaro
 
PDF
Android's Multimedia Framework
Opersys inc.
 
PDF
Understanding the Android System Server
Opersys inc.
 
PPTX
Introduction of android treble
Bin Yang
 
PPT
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
PPT
Learning AOSP - Android Booting Process
Nanik Tolaram
 
Low Level View of Android System Architecture
National Cheng Kung University
 
Android device driver structure introduction
William Liang
 
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Android Internals
Opersys inc.
 
Uboot startup sequence
Houcheng Lin
 
Android's HIDL: Treble in the HAL
Opersys inc.
 
Embedded Android : System Development - Part II (HAL)
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
Embedded Android Workshop
Opersys inc.
 
Overview of Android binder IPC implementation
Chethan Pchethan
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 
Linux Porting
Champ Yen
 
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Android OTA updates
Gary Bisson
 
Q4.11: Porting Android to new Platforms
Linaro
 
Android's Multimedia Framework
Opersys inc.
 
Understanding the Android System Server
Opersys inc.
 
Introduction of android treble
Bin Yang
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Learning AOSP - Android Booting Process
Nanik Tolaram
 

Viewers also liked (20)

PDF
From Android NDK To AOSP
Min-Yih Hsu
 
PDF
How to build rock solid apps & keep 100m+ users happy
Iordanis (Jordan) Giannakakis
 
PPTX
Battery Optimization for Android Apps - Devoxx14
Murat Aydın
 
PDF
A Deep Dive into Open Source Android Development
David Wu
 
PPTX
Android content providers
Kurt Mbanje
 
PDF
Android Embedded - Einführung in Android als Embedded-Plattform
inovex GmbH
 
PDF
Android porting-on-embedded-platform v2-0633850602027036930
weitulislide
 
PPT
Content providers in Android
Alexey Ustenko
 
PDF
Embedded Android Market Development
VIA Embedded
 
PDF
Embedded Android Real-Time Streaming Optimization
VIA Embedded
 
PDF
Android Internals at Linaro Connect Asia 2013
Opersys inc.
 
PDF
Brillo / Weave Internals
Opersys inc.
 
PDF
Embedded Android Workshop with Marshmallow
Opersys inc.
 
PDF
The Third Network: LSO, SDN and NFV
OPNFV
 
PDF
Remote Management of Embedded Android Devices
VIA Embedded
 
PDF
Memory Management in Android
Opersys inc.
 
PDF
LAS16-400: Mini Conference 3 AOSP (Session 1)
Linaro
 
PPTX
Content provider in_android
PRITI TELMORE
 
PDF
Embedded Android Workshop with Nougat
Opersys inc.
 
From Android NDK To AOSP
Min-Yih Hsu
 
How to build rock solid apps & keep 100m+ users happy
Iordanis (Jordan) Giannakakis
 
Battery Optimization for Android Apps - Devoxx14
Murat Aydın
 
A Deep Dive into Open Source Android Development
David Wu
 
Android content providers
Kurt Mbanje
 
Android Embedded - Einführung in Android als Embedded-Plattform
inovex GmbH
 
Android porting-on-embedded-platform v2-0633850602027036930
weitulislide
 
Content providers in Android
Alexey Ustenko
 
Embedded Android Market Development
VIA Embedded
 
Embedded Android Real-Time Streaming Optimization
VIA Embedded
 
Android Internals at Linaro Connect Asia 2013
Opersys inc.
 
Brillo / Weave Internals
Opersys inc.
 
Embedded Android Workshop with Marshmallow
Opersys inc.
 
The Third Network: LSO, SDN and NFV
OPNFV
 
Remote Management of Embedded Android Devices
VIA Embedded
 
Memory Management in Android
Opersys inc.
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
Linaro
 
Content provider in_android
PRITI TELMORE
 
Embedded Android Workshop with Nougat
Opersys inc.
 
Ad

Similar to Deep Dive into the AOSP (20)

PDF
Docker module 1
Liang Bo
 
PPTX
ASP.NET 5 auf Raspberry PI & docker
Jürgen Gutsch
 
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
PDF
Deploying to Ubuntu on Linode
WO Community
 
PPTX
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Manuel Garcia
 
PDF
The development environment
Lee Pelser
 
PDF
Deliver Python Apps with Docker
Anton Egorov
 
PDF
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
ODP
Android porting for dummies @droidconin 2011
pundiramit
 
PDF
Windows container security
Docker, Inc.
 
PPTX
Reactive summit 2020 microsoft orleans the easy way
John Azariah
 
PPTX
Core os dna_oscon
Patrick Galbraith
 
PDF
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 
PDF
24HOP Introduction to Linux for SQL Server DBAs
Kellyn Pot'Vin-Gorman
 
PPTX
Building an iOS Build Server
Attila Tamás Zimler
 
PDF
yocto_scale_handout-with-notes
Steve Arnold
 
PPTX
Rhodes mobile Framework
Yoshi Sakai
 
PDF
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Cheng-Yi Yu
 
PDF
Dockerizing Oracle Database
gvenzl
 
PPTX
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow
 
Docker module 1
Liang Bo
 
ASP.NET 5 auf Raspberry PI & docker
Jürgen Gutsch
 
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
Deploying to Ubuntu on Linode
WO Community
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Manuel Garcia
 
The development environment
Lee Pelser
 
Deliver Python Apps with Docker
Anton Egorov
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
Android porting for dummies @droidconin 2011
pundiramit
 
Windows container security
Docker, Inc.
 
Reactive summit 2020 microsoft orleans the easy way
John Azariah
 
Core os dna_oscon
Patrick Galbraith
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 
24HOP Introduction to Linux for SQL Server DBAs
Kellyn Pot'Vin-Gorman
 
Building an iOS Build Server
Attila Tamás Zimler
 
yocto_scale_handout-with-notes
Steve Arnold
 
Rhodes mobile Framework
Yoshi Sakai
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Cheng-Yi Yu
 
Dockerizing Oracle Database
gvenzl
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow
 
Ad

Recently uploaded (20)

PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
July Patch Tuesday
Ivanti
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Biography of Daniel Podor.pdf
Daniel Podor
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 

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