Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Your Own Android Systems from Source Adam C. Champion CSE 5236: Mobile App Development 1.

Similar presentations


Presentation on theme: "Building Your Own Android Systems from Source Adam C. Champion CSE 5236: Mobile App Development 1."— Presentation transcript:

1 Building Your Own Android Systems from Source Adam C. Champion CSE 5236: Mobile App Development 1

2 Outline Motivation Preparing a Build Environment Obtaining Source Code Building Systems 2

3 Motivation Why build your own system? – Full control over device software (remove “bloat,” address security and privacy) – Extend device lifetime beyond “official” OS support – Research (e.g., wireless networking, mobile systems, etc.) – Customize device (e.g., themes, lockscreens) Disclaimers: – This will definitely void your warranty – system building is at your own risk! I am not responsible if you “brick” your device! – Using a custom Android system on a cellular network may violate your network operator’s terms of service – We’ll only cover building Android Open Source Project (AOSP); Google services are proprietary 3

4 Preparing a Build Environment (1) What you’ll need: [1] – 64-bit Mac OS X or Linux (Ubuntu LTS, Debian)* – ≥ 16 GB RAM – ≥ 150 GB disk space to build Android system; ≥ 200 GB for multiple builds – JDK version 5–7 (see table) – Python 2.6–2.7 – GNU Make 3.81–3.82 – Git – A few hours … JDK VersionAndroid Version to be Compiled 51.5–2.2 62.3–4.4 75+ 4 * MS Windows users need to create Linux VM (e.g., using VirtualBox [2]). The above system requirements are minimum for building (plus VM overhead).

5 Preparing a Build Environment (2) Install prerequisites [3]: – OS X: Xcode, command-line utilities (Mac App Store); GNU make, git, ccache from MacPorts, Homebrew – Linux: Software updates, needed packages [3] – ccache is strongly recommended to speed up build process [3] Linux users need to enable USB access: [4] wget -S -O - http://source.android.com/source/51- android.rules | sed "s/ /$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules 5

6 Preparing a Build Environment (3) Install repo, create a working directory. Run the following in a shell: [4] $ mkdir ~/bin $ PATH=~/bin:$PATH $ curl https://storage.googleapis.com/git-repo- downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY $ repo init -u https://android.googlesource.com/platform/manifest https://android.googlesource.com/platform/manifest $ repo sync –Be prepared to wait a few hours, especially with the last command! 6

7 Building the System Run the following in a shell: [4] $. build/envsetup.sh $ lunch $ # Pick an option. Make sure to select a “*- userdebug” or “*-eng” build $ export USE_CCACHE=1 $ export CCACHE_DIR=/ /.ccache $ prebuilts/misc/linux-x86/ccache/ccache -M 50G $ make -j4 On OS X, replace linux-x86 with darwin-x86 This process takes several hours. An SSD greatly decreases compile time… 7

8 Installing System on Device Prerequisites: – Unlock device bootloader (voids warranty) – Get root access on your device (varies for device, voids warranty) Google Nexus devices (up to Nexus 6) strongly recommended for system building Ensure you download the proprietary binaries for your (Nexus) device from [5], device manufacturer Then run tar xvzf at a shell for each downloaded driver (may vary for devices) Now run at a shell: $ adb reboot bootloader $ fastboot flashall -w 8

9 More to Explore Build CyanogenMod (a custom Android ROM) via similar process as AOSP [6] Xposed: JAR file loaded into each Android executable for customization [7] Bluetooth: Swap Linux BlueZ stack with Android’s “BlueDroid” on Nexus devices [8] F-Droid: Free/open-source Android software repository alternative to Google Play [9] The rest is up to you! 9

10 Thank You Questions and comments? 10

11 References 1.AOSP, https://source.android.com/source/requirements.htmlhttps://source.android.com/source/requirements.html 2.Oracle, VirtualBox, http://www.virtualbox.orghttp://www.virtualbox.org 3.AOSP, https://source.android.com/source/initializing.htmlhttps://source.android.com/source/initializing.html 4.AOSP, https://source.android.com/source/downloading.htmlhttps://source.android.com/source/downloading.html 5.Google Inc., https://developers.google.com/android/nexus/drivershttps://developers.google.com/android/nexus/drivers 6.CyanogenMod, https://wiki.cyanogenmod.org/w/Main_Pagehttps://wiki.cyanogenmod.org/w/Main_Page 7.XDA-Developers, http://forum.xda-developers.com/xposed/xposed- installer-versions-changelog-t2714053http://forum.xda-developers.com/xposed/xposed- installer-versions-changelog-t2714053 8.AOSP-BlueZ, https://code.google.com/p/aosp-bluez/https://code.google.com/p/aosp-bluez/ 9.F-Droid, http://f-droid.orghttp://f-droid.org 11


Download ppt "Building Your Own Android Systems from Source Adam C. Champion CSE 5236: Mobile App Development 1."

Similar presentations


Ads by Google