{"id":1063,"date":"2018-06-05T09:58:33","date_gmt":"2018-06-05T00:58:33","guid":{"rendered":"http:\/\/manatails.net\/blog\/?p=1063"},"modified":"2022-04-03T13:48:54","modified_gmt":"2022-04-03T04:48:54","slug":"building-userdebug-android-images-for-pixel","status":"publish","type":"post","link":"https:\/\/manatails.net\/blog\/2018\/06\/building-userdebug-android-images-for-pixel\/","title":{"rendered":"Building userdebug android images for Pixel"},"content":{"rendered":"<p>Those are the steps I took to build userdebug images for google Pixel on Ubtuntu 16.04. As the original google documentation is so unorganized and difficult to understand I&#8217;ve summed up the important parts to get a quick build for any device. I&#8217;m quite unsure about the package dependencies and there might be some more packages you need. Let me know if you needed more packages on clean install of Ubuntu.<\/p>\n<p>1. First start with installing necessary packages<br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">sudo apt-get update\r\nsudo apt-get install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk<\/pre>\n<p>2. Building android somehow requires some x86 libraries so install them as well<br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">sudo dpkg --add-architecture i386\r\nsudo apt-get update\r\nsudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386<\/pre>\n<p>3. Download repo client and install it somewhere<br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">mkdir ~\/bin\r\nPATH=~\/bin:$PATH\r\n\r\ncurl https:\/\/storage.googleapis.com\/git-repo-downloads\/repo &gt; ~\/bin\/repo\r\nchmod a+x ~\/bin\/repo<\/pre>\n<p>4. Make source directory and add git information for checkout<br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">mkdir android_dev\r\ncd android_dev\r\n\r\ngit config --global user.name \"Your Name\"\r\ngit config --global user.email \"someaddress@someprovider.com\"<\/pre>\n<p>5. Download actual source and build environment<br \/>\nBranch names can be found at <a href=\"https:\/\/source.android.com\/setup\/start\/build-numbers\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/source.android.com\/setup\/start\/build-numbers<\/a><br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">repo init -u https:\/\/android.googlesource.com\/platform\/manifest -b android-8.1.0_r28\r\n\r\nrepo sync\r\n\r\nmake clobber\r\n<\/pre>\n<p>6. (OPTIONAL) Download nonfree drivers, if you skip this step vendor.img will not be built.<br \/>\nMatching drivers can be found at <a href=\"https:\/\/developers.google.com\/android\/drivers\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/developers.google.com\/android\/drivers<\/a><br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">wget https:\/\/dl.google.com\/dl\/android\/aosp\/google_devices-sailfish-opm4.171019.016.b1-839e6b26.tgz\r\nwget https:\/\/dl.google.com\/dl\/android\/aosp\/qcom-sailfish-opm4.171019.016.b1-3c7f92b3.tgz\r\n\r\ntar xvf google_devices-sailfish-opm4.171019.016.b1-839e6b26.tgz\r\ntar xvf qcom-sailfish-opm4.171019.016.b1-3c7f92b3.tgz\r\n\r\n.\/extract-google_devices-sailfish.sh\r\n.\/extract-qcom-sailfish.sh<\/pre>\n<p>7. Prepare build options and make<br \/>\nAvailable build configurations can be found at <a href=\"https:\/\/source.android.com\/setup\/build\/running\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/source.android.com\/setup\/build\/running<\/a><br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">source build\/envsetup.sh\r\n\r\nlunch aosp_sailfish-userdebug\r\n\r\nmake -j8<\/pre>\n<p>Resulting image files can be found at out\/target\/product\/&lt;device_name&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>Troubleshooting #1. If build fails with &#8220;out of heap space&#8221; error, execute the commands below and continue make<br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">export JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g\"\r\njack-admin kill-server &amp;&amp; jack-admin start-server<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Those are the steps I took to build userdebug images for google Pixel on Ubtuntu 16.04. As the original google documentation is so unorganized and difficult to understand I&#8217;ve summed up the important parts to get a quick build for any device. I&#8217;m quite unsure about the package dependencies and there might be some more &hellip; <a href=\"https:\/\/manatails.net\/blog\/2018\/06\/building-userdebug-android-images-for-pixel\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Building userdebug android images for Pixel<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,23],"tags":[22],"class_list":["post-1063","post","type-post","status-publish","format-standard","hentry","category-computer","category-phone","tag-android"],"_links":{"self":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/1063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/comments?post=1063"}],"version-history":[{"count":12,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/1063\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/1063\/revisions\/1210"}],"wp:attachment":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/media?parent=1063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/categories?post=1063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/tags?post=1063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}