SlideShare a Scribd company logo
1 of 28
Download to read offline
Android internals
    Egor Elizarov
    SPbSU 2012
Legal info
   Android internals by Egor Elizarov is licensed under a
    Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

   You are free to
      – copy, distribute, display, and perform the work
      – make derivative works
   Under the following conditions
       – Attribution. You must give the original author credit
       – Share Alike. If you alter, transform, or build upon this work, you may
         distribute the resulting work only under a license identical to this one
   All pictures and trademarks are the property of their respective owners. Use of
    these trademarks and pictures is subject to owners permissions.
   Corrections, suggestions, contributions and translations are welcome!



                                          2                                 Egor Elizarov SPbSU 2012
Lecture 3



                          Android build system,
                                Emulator



                                                  yegor.yelizarov(at)gmail.com
Rev: 1.1
Last update: 05/30/2012                       http://vk.com/android_internals


                                    3                              Egor Elizarov SPbSU 2012
Previous time

    AOSP

    High level architecture

    Android OS bring up

    CTS & CDD

    repo / git / gerrit

    Code layout

                              4    Egor Elizarov SPbSU 2012
Android build system

    Based on GNU Make

    Build system code is in “build” directory
    (./build/core/main.mk - start point)

    Android.mk files

    All output and temporary files are in “out”
    directory


                           5                      Egor Elizarov SPbSU 2012
Makefile structure


    Structure:
    Target: depenencies
     List of commands

    Usage:
    make target



                          6       Egor Elizarov SPbSU 2012
Interesting files


    Android.mk — build scenario for module

    buildspec.mk — variable defenitions for build
    system

    envsetup.sh — setup environment, add some
    helper functions



                          7                    Egor Elizarov SPbSU 2012
Sample Android.mk
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := list_of_sources

LOCAL_C_INCLUDES := list_of_directories_with_header_files

LOCAL_SHARED_LIBRARIES := list_of_shared_libraries

LOCAL_STATIC_LABRARIES := list_of_static_libraries

LOCAL_MODULE_TAGS := debug

LOCAL_MODULE := module_name

include $(BUILD_EXECUTABLE)



                                     8                      Egor Elizarov SPbSU 2012
More variables

    LOCAL_MODULE_PATH := install_path

    LOCAL_CFLAGS := flags_for_compiler

    LOCAL_LDFLAGS := flags_for_linker

    LOCAL_OVERRIDES_PACKAGES :=
    packages_to_be_dropped

    Etc.

                       9                 Egor Elizarov SPbSU 2012
Target hierarchy
 CPU type


       Bare schematics

                         Fixed peripherals


                                             Fixed applications




             10                                Egor Elizarov SPbSU 2012
buildspec.mk

    TARGER_PRODUCT = product_name

    TARGET_BUILD_TYPE = debug

    SHOW_COMMANDS = true

    USE_CCACHE = 1

    BUILD_TINY_ANDROID = true (board bring
    up/ low level debugging)

                      11               Egor Elizarov SPbSU 2012
Some make targets


    make droid (default target)

    make update-api (update current API)

    make sdk (build SDK)

    make help (prints more targets)



                          12               Egor Elizarov SPbSU 2012
Build process




     13         Egor Elizarov SPbSU 2012
Building AOSP


    cd AOSP

    . build/envsetup.sh

    lunch

    Select generic-eng version

    make -j4


                          14     Egor Elizarov SPbSU 2012
Add new program




      15          Egor Elizarov SPbSU 2012
Board specific files


    BoardConfig.mk (Target configuration)

    Board_name.mk (board related defenitions, list
    of packages)

    Device.mk (list of files to be copied, list of
    packages, etc.)



                            16                       Egor Elizarov SPbSU 2012
Android emulator


    Based on Qemu VM

    Goldfish – codename for emulator

    Code in development/tools/emulator &
    external/qemu

    Provided as part of SDK


                         17                Egor Elizarov SPbSU 2012
Emulator features

    Runs full Android stack down to the kernel level

    ARM v5 CPU and correcponding MMU

    LCD with different resolutions

    GSM modem

    Simulates application interrupts, data channel
    lost, etc.

                           18                    Egor Elizarov SPbSU 2012
Qemu


    Single loop for each core

    Worker threads for long term tasks

    Tiny Code Generator (TCG)

    Kernel Virtual Machine (KVM)



                          19             Egor Elizarov SPbSU 2012
Emulator window




      20          Egor Elizarov SPbSU 2012
Tools


    android — control AVD, update SDK, manage
    android projects

    emulator — launches emulator

    adb — remote debug console

    mksdcard — create SD card image


                        21                Egor Elizarov SPbSU 2012
Android Debug Bridge

    adb kill-server

    adb devices

    adb logcat

    adb shell

    adb push what where

    adb pull what where

                          22    Egor Elizarov SPbSU 2012
ADB internals




          USB or TCP/IP

     23                   Egor Elizarov SPbSU 2012
Launch emulator



    $ out/host/linux-x86/bin/emulator &

    $ adb kill-server

    $ adb shell




                         24               Egor Elizarov SPbSU 2012
Target filesystem layout

    /system — main system directory

    /data — main data directory

    /cache — Dalvik cache

    /sdcard — SD card mount point

    /etc; /sys; /proc; /dev; /sbin; /root; /mnt —
    derived from linux

                            25                      Egor Elizarov SPbSU 2012
Next time



    “Androdized” kernel

    Bionic standard C library

    Logging system

                                Source: http://androidcommunity.com




                          26                                Egor Elizarov SPbSU 2012
Useful links

   http://vk.com/android_internals
   http://mrbook.org/tutorials/make/
   http://elinux.org/Android_Build_System
   K. Yaghmour. Embedded Android. Early Release, O'Reilly, October 2011
   http://developer.android.com/guide/developing/tools/emulator.html
   http://developer.android.com/guide/developing/devices/emulator.html
   http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html




                                         27                               Egor Elizarov SPbSU 2012
Thanks to


    Sergey Matyukevich for review and advices
    (www.linkedin.com/pub/sergey-
    matyukevich/31/889/769)

    Nikolay F. Fominykh for review and advices

    Nikita Shulga for advices and notes
    (http://www.linkedin.com/pub/nikita-
    shulga/8/582/287)

                          28                    Egor Elizarov SPbSU 2012

More Related Content

What's hot

Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Egor Elizarov
 
Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Egor Elizarov
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updatesGary Bisson
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesChris Simmonds
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Sarath C
 
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)Matthias Brugger
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 

What's hot (20)

Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)Android internals 07 - Android graphics (rev_1.1)
Android internals 07 - Android graphics (rev_1.1)
 
Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Exoplayer 2
Exoplayer  2Exoplayer  2
Exoplayer 2
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
 
How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?
 
Android 10
Android 10Android 10
Android 10
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Android Custom Kernel/ROM design
Android Custom Kernel/ROM designAndroid Custom Kernel/ROM design
Android Custom Kernel/ROM design
 

Viewers also liked

Going Beyond the Device Heart Beat
Going Beyond the Device Heart BeatGoing Beyond the Device Heart Beat
Going Beyond the Device Heart BeatBalwinder Kaur
 
Android 5.0 Camera2 APIs
Android 5.0 Camera2 APIsAndroid 5.0 Camera2 APIs
Android 5.0 Camera2 APIsBalwinder Kaur
 
Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trendsSoumya Kanti Datta
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
 
Smart Phone CPU
Smart Phone CPUSmart Phone CPU
Smart Phone CPU오석 한
 
Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Balwinder Kaur
 
Samsung processors: Exynos family
Samsung processors: Exynos familySamsung processors: Exynos family
Samsung processors: Exynos familySagar Patel
 
Android カスタムROMの作り方
Android カスタムROMの作り方Android カスタムROMの作り方
Android カスタムROMの作り方Masahiro Hidaka
 
Performance Comparison Between x86 and ARM Assembly
Performance Comparison Between x86 and ARM AssemblyPerformance Comparison Between x86 and ARM Assembly
Performance Comparison Between x86 and ARM AssemblyManasa K
 
Motion recognition with Android devices
Motion recognition with Android devicesMotion recognition with Android devices
Motion recognition with Android devicesGabor Paller
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors APIeleksdev
 
CPU Architectures for Mobile Phone Devices
CPU Architectures for Mobile Phone DevicesCPU Architectures for Mobile Phone Devices
CPU Architectures for Mobile Phone Devicessagar chansaulia
 

Viewers also liked (18)

IoT in the Enterprise
IoT in the EnterpriseIoT in the Enterprise
IoT in the Enterprise
 
Going Beyond the Device Heart Beat
Going Beyond the Device Heart BeatGoing Beyond the Device Heart Beat
Going Beyond the Device Heart Beat
 
Android 5.0 Camera2 APIs
Android 5.0 Camera2 APIsAndroid 5.0 Camera2 APIs
Android 5.0 Camera2 APIs
 
Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trends
 
Power management android
Power management androidPower management android
Power management android
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)
 
Game controlling via android
Game controlling via androidGame controlling via android
Game controlling via android
 
Smart Phone CPU
Smart Phone CPUSmart Phone CPU
Smart Phone CPU
 
Real time simulation with HLA and DDS
Real time simulation with HLA and DDSReal time simulation with HLA and DDS
Real time simulation with HLA and DDS
 
Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2 Camera 2.0 in Android 4.2
Camera 2.0 in Android 4.2
 
Samsung processors: Exynos family
Samsung processors: Exynos familySamsung processors: Exynos family
Samsung processors: Exynos family
 
Android カスタムROMの作り方
Android カスタムROMの作り方Android カスタムROMの作り方
Android カスタムROMの作り方
 
Android Sensors
Android SensorsAndroid Sensors
Android Sensors
 
Review Multicore processing based on ARM architecture
Review Multicore processing based on ARM architectureReview Multicore processing based on ARM architecture
Review Multicore processing based on ARM architecture
 
Performance Comparison Between x86 and ARM Assembly
Performance Comparison Between x86 and ARM AssemblyPerformance Comparison Between x86 and ARM Assembly
Performance Comparison Between x86 and ARM Assembly
 
Motion recognition with Android devices
Motion recognition with Android devicesMotion recognition with Android devices
Motion recognition with Android devices
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
 
CPU Architectures for Mobile Phone Devices
CPU Architectures for Mobile Phone DevicesCPU Architectures for Mobile Phone Devices
CPU Architectures for Mobile Phone Devices
 

Similar to Android internals 03 - Build system, emulator (rev_1.1)

OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Build and Run Android N Source Ccode on NXP SABRESD platform
Build and Run Android N Source Ccode on NXP SABRESD platformBuild and Run Android N Source Ccode on NXP SABRESD platform
Build and Run Android N Source Ccode on NXP SABRESD platformDaniel Chiu
 
Modules and EmbedJS
Modules and EmbedJSModules and EmbedJS
Modules and EmbedJSJens Arps
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging SystemWilliam Lee
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: IntroductionJollen Chen
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdkTran Le Hoan
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentWillow Cheng
 
Android open source project build system phi innovations - android summit 2015
Android open source project build system   phi innovations - android summit 2015Android open source project build system   phi innovations - android summit 2015
Android open source project build system phi innovations - android summit 2015Rafael Coutinho
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSLYoss Cohen
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKMarco Cavallini
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemLinaro
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 

Similar to Android internals 03 - Build system, emulator (rev_1.1) (20)

OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
Build and Run Android N Source Ccode on NXP SABRESD platform
Build and Run Android N Source Ccode on NXP SABRESD platformBuild and Run Android N Source Ccode on NXP SABRESD platform
Build and Run Android N Source Ccode on NXP SABRESD platform
 
Aosp+
Aosp+Aosp+
Aosp+
 
Modules and EmbedJS
Modules and EmbedJSModules and EmbedJS
Modules and EmbedJS
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdk
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android Development
 
Android open source project build system phi innovations - android summit 2015
Android open source project build system   phi innovations - android summit 2015Android open source project build system   phi innovations - android summit 2015
Android open source project build system phi innovations - android summit 2015
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
 
Building aosp
Building aospBuilding aosp
Building aosp
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Code crunch
Code crunchCode crunch
Code crunch
 

Recently uploaded

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Recently uploaded (20)

YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

Android internals 03 - Build system, emulator (rev_1.1)

  • 1. Android internals Egor Elizarov SPbSU 2012
  • 2. Legal info  Android internals by Egor Elizarov is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License  You are free to – copy, distribute, display, and perform the work – make derivative works  Under the following conditions – Attribution. You must give the original author credit – Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one  All pictures and trademarks are the property of their respective owners. Use of these trademarks and pictures is subject to owners permissions.  Corrections, suggestions, contributions and translations are welcome! 2 Egor Elizarov SPbSU 2012
  • 3. Lecture 3 Android build system, Emulator yegor.yelizarov(at)gmail.com Rev: 1.1 Last update: 05/30/2012 http://vk.com/android_internals 3 Egor Elizarov SPbSU 2012
  • 4. Previous time  AOSP  High level architecture  Android OS bring up  CTS & CDD  repo / git / gerrit  Code layout 4 Egor Elizarov SPbSU 2012
  • 5. Android build system  Based on GNU Make  Build system code is in “build” directory (./build/core/main.mk - start point)  Android.mk files  All output and temporary files are in “out” directory 5 Egor Elizarov SPbSU 2012
  • 6. Makefile structure  Structure: Target: depenencies List of commands  Usage: make target 6 Egor Elizarov SPbSU 2012
  • 7. Interesting files  Android.mk — build scenario for module  buildspec.mk — variable defenitions for build system  envsetup.sh — setup environment, add some helper functions 7 Egor Elizarov SPbSU 2012
  • 8. Sample Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := list_of_sources LOCAL_C_INCLUDES := list_of_directories_with_header_files LOCAL_SHARED_LIBRARIES := list_of_shared_libraries LOCAL_STATIC_LABRARIES := list_of_static_libraries LOCAL_MODULE_TAGS := debug LOCAL_MODULE := module_name include $(BUILD_EXECUTABLE) 8 Egor Elizarov SPbSU 2012
  • 9. More variables  LOCAL_MODULE_PATH := install_path  LOCAL_CFLAGS := flags_for_compiler  LOCAL_LDFLAGS := flags_for_linker  LOCAL_OVERRIDES_PACKAGES := packages_to_be_dropped  Etc. 9 Egor Elizarov SPbSU 2012
  • 10. Target hierarchy CPU type Bare schematics Fixed peripherals Fixed applications 10 Egor Elizarov SPbSU 2012
  • 11. buildspec.mk  TARGER_PRODUCT = product_name  TARGET_BUILD_TYPE = debug  SHOW_COMMANDS = true  USE_CCACHE = 1  BUILD_TINY_ANDROID = true (board bring up/ low level debugging) 11 Egor Elizarov SPbSU 2012
  • 12. Some make targets  make droid (default target)  make update-api (update current API)  make sdk (build SDK)  make help (prints more targets) 12 Egor Elizarov SPbSU 2012
  • 13. Build process 13 Egor Elizarov SPbSU 2012
  • 14. Building AOSP  cd AOSP  . build/envsetup.sh  lunch  Select generic-eng version  make -j4 14 Egor Elizarov SPbSU 2012
  • 15. Add new program 15 Egor Elizarov SPbSU 2012
  • 16. Board specific files  BoardConfig.mk (Target configuration)  Board_name.mk (board related defenitions, list of packages)  Device.mk (list of files to be copied, list of packages, etc.) 16 Egor Elizarov SPbSU 2012
  • 17. Android emulator  Based on Qemu VM  Goldfish – codename for emulator  Code in development/tools/emulator & external/qemu  Provided as part of SDK 17 Egor Elizarov SPbSU 2012
  • 18. Emulator features  Runs full Android stack down to the kernel level  ARM v5 CPU and correcponding MMU  LCD with different resolutions  GSM modem  Simulates application interrupts, data channel lost, etc. 18 Egor Elizarov SPbSU 2012
  • 19. Qemu  Single loop for each core  Worker threads for long term tasks  Tiny Code Generator (TCG)  Kernel Virtual Machine (KVM) 19 Egor Elizarov SPbSU 2012
  • 20. Emulator window 20 Egor Elizarov SPbSU 2012
  • 21. Tools  android — control AVD, update SDK, manage android projects  emulator — launches emulator  adb — remote debug console  mksdcard — create SD card image 21 Egor Elizarov SPbSU 2012
  • 22. Android Debug Bridge  adb kill-server  adb devices  adb logcat  adb shell  adb push what where  adb pull what where 22 Egor Elizarov SPbSU 2012
  • 23. ADB internals USB or TCP/IP 23 Egor Elizarov SPbSU 2012
  • 24. Launch emulator  $ out/host/linux-x86/bin/emulator &  $ adb kill-server  $ adb shell 24 Egor Elizarov SPbSU 2012
  • 25. Target filesystem layout  /system — main system directory  /data — main data directory  /cache — Dalvik cache  /sdcard — SD card mount point  /etc; /sys; /proc; /dev; /sbin; /root; /mnt — derived from linux 25 Egor Elizarov SPbSU 2012
  • 26. Next time  “Androdized” kernel  Bionic standard C library  Logging system Source: http://androidcommunity.com 26 Egor Elizarov SPbSU 2012
  • 27. Useful links  http://vk.com/android_internals  http://mrbook.org/tutorials/make/  http://elinux.org/Android_Build_System  K. Yaghmour. Embedded Android. Early Release, O'Reilly, October 2011  http://developer.android.com/guide/developing/tools/emulator.html  http://developer.android.com/guide/developing/devices/emulator.html  http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html 27 Egor Elizarov SPbSU 2012
  • 28. Thanks to  Sergey Matyukevich for review and advices (www.linkedin.com/pub/sergey- matyukevich/31/889/769)  Nikolay F. Fominykh for review and advices  Nikita Shulga for advices and notes (http://www.linkedin.com/pub/nikita- shulga/8/582/287) 28 Egor Elizarov SPbSU 2012