{"id":127,"date":"2024-05-22T10:08:39","date_gmt":"2024-05-22T02:08:39","guid":{"rendered":"https:\/\/blog.superfyx.top\/?p=127"},"modified":"2024-06-13T10:05:10","modified_gmt":"2024-06-13T02:05:10","slug":"android%e6%ba%90%e7%a0%81%e4%b8%8b%e8%bd%bd%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"https:\/\/blog.superfyx.top\/?p=127","title":{"rendered":"Android\u6e90\u7801\u4e0b\u8f7d\u7f16\u8bd1"},"content":{"rendered":"\n<p>\u673a\u5668\u914d\u7f6e\u9ad8\u4e00\u70b9\uff0ccpu\u5f3a\u4e00\u70b932\u6838\u8d77\u6b65\u5427\uff0c\u5b58\u50a8\u7a7a\u95f4\u820d\u5f97\u70b9\u7ed9\u4e2a400~500G\u5427<\/p>\n\n\n\n<p>\u6b65\u9aa41\uff1aRepo \u5de5\u5177\u4e0b\u8f7d<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>mkdir ~\/bin\nPATH=~\/bin:$PATH\ncurl -sSL  'https:\/\/gerrit-googlesource.proxy.ustclug.org\/git-repo\/+\/master\/repo?format=TEXT' |base64 -d &gt; ~\/bin\/repo\nchmod a+x ~\/bin\/repo<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa42\uff1a\u914d\u7f6e\u4e2a\u4eba\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>git config --global user.name \"Your Name\" \ngit config --global user.email \"you@example.com\"\n<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa43\uff1a\u521b\u5efa\u5de5\u7a0b\u76ee\u5f55<\/p>\n\n\n\n<p>mkdir ANDROID_SOURCE<br>cd ANDROID_SOURCE<\/p>\n\n\n\n<p>\u6b65\u9aa44\uff1a\u521d\u59cb\u5316\u4ed3\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>export REPO_URL='https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/git-repo\/'\nrepo init -u https:\/\/aosp.tuna.tsinghua.edu.cn\/platform\/manifest<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa45\uff1a\u6307\u5b9a\u6211\u4eec\u9700\u8981\u4e0b\u8f7d\u7684\u6e90\u7801\u5206\u652f\u5e76\u521d\u59cb\u5316\u5bf9\u5e94\u7248\u672c<a href=\"https:\/\/source.android.com\/docs\/setup\/about\/build-numbers?hl=zh-cn#source-code-tags-and-builds\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/source.android.com\/docs\/setup\/about\/build-numbers?hl=zh-cn#source-code-tags-and-builds<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>repo init -u https:\/\/aosp.tuna.tsinghua.edu.cn\/platform\/manifest -b android-9.0.0_r46\n\u6216\u800513\u7248\u672c\nrepo init -u https:\/\/aosp.tuna.tsinghua.edu.cn\/platform\/manifest -b android-13.0.0_r43<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa46\uff1a\u6267\u884c\u547d\u4ee4\u4e0b\u8f7d<\/p>\n\n\n\n<p>repo sync -j4<\/p>\n\n\n\n<p>\u6216\u8005\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u81ea\u52a8\u7ee7\u7eed\u811a\u672c<\/p>\n\n\n\n<p>cd ANDROID_SOURCE<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>touch repo.sh  # 1. \u521b\u5efa repo.sh \u6587\u4ef6\nvim repo.sh # 2. \u590d\u5236\u4e0a\u9762\u7684\u811a\u672c\u5185\u5bb9\u5230 repo.sh \u91cc\u9762\uff0c\u8fd9\u91cc\u4f60\u53ef\u4ee5\u4f7f\u7528\u4f60\u81ea\u5df1\u559c\u6b22\u7684\u65b9\u6cd5\u6253\u5f00\u5e76\u4fee\u6539\u6587\u4ef6\uff0c\u6bd4\u5982 vscode\nchmod a+x repo.sh #3. \u4fee\u6539\u6743\u9650\n.\/repo.sh # 4. \u8fd0\u884c\u811a\u672c\uff0c\u4e07\u4e8b\u5927\u5409<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa47\uff1a\u7f16\u8bd1\u6e90\u7801\uff08\u5b89\u88c5\u5de5\u5177\uff09<\/p>\n\n\n\n<p>\u9996\u5148\u5b89\u88c5\u6240\u9700\u8981\u7684\u6240\u6709\u7684\u5de5\u5177\u5305\uff0c\u8fd9\u4e2a\u968f\u4fbf\u627e\u4e2a\u5148\u5b89\u88c5\u4e86\uff0c\u81f3\u4e8e\u7f3a\u5c11\u4ec0\u4e48\uff0c\u81ea\u5df1\u518d\u6839\u636e\u5b9e\u9645\u7684\u60c5\u51b5\u6765\u8865\u5145\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sudo apt-get update\nsudo apt-get install openjdk-11-jdk\nsudo apt-get install git\nsudo apt-get install gnupg\nsudo apt-get install flex bison gperf build-essential \\\n  zip curl zlib1g-dev gcc-multilib g++-multilib \\\n  libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev \\\n  libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils \\\n  xsltproc unzip fontconfig\n<\/code><\/pre>\n\n\n\n<p>\u6b65\u9aa48\uff1a\u7f16\u8bd1\u6e90\u7801\uff08\u7f16\u8bd1\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>source build\/envsetup.sh\nlunch #\u8fd9\u4e2a\u6307\u4ee4\u6267\u884c\u4e4b\u540e\u4f1a\u6709\u9009\u62e9\u7f16\u8bd1\u76ee\u6807\uff0c\u6211\u7684\u56e0\u4e3a\u662fAndroid13\u5e76\u4e14\u6ca1\u6709\u771f\u5b9e\u673a\u5668\uff0c\u53ea\u80fd\u4f7f\u7528\u6a21\u62df\u5668\uff0c\u6700\u5148\u65cb\u8f6c\u7684\u662faosp_x86_64-eng\uff0c\u4f46\u5b9e\u9645\u4f7f\u7528\u8fc7\u7a0b\u4e2dAndroid13\u8fd9\u4e2a\u7248\u672c\u7f16\u8bd1\u4e4b\u540e\u6ca1\u6709userdata.img\u6587\u4ef6\uff0c\u540e\u6765\u9009\u62e9\u4e86<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">sdk_pc_x86_64-userdebug<\/mark>\u5c31\u53ef\u4ee5\u4e86\nm #\u6267\u884c\u8fd9\u4e2a\u5c31\u5f00\u59cb\u7f16\u8bd1\u4e86\uff08\u4e5f\u53ef\u4ee5\u6267\u884cmake -j8,m\u4f1a\u81ea\u52a8\u9009\u62e9\u4f7f\u7528\u591a\u4e2a\u7ebf\u7a0b\u7684\uff09<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684\u7f16\u8bd1\u82e5\u662f\u6709\u95ee\u9898\u5c31\u5bf9\u5e94\u627e\u5b89\u88c5\u5305<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"733\" height=\"358\" src=\"https:\/\/blog.superfyx.top\/wp-content\/uploads\/2024\/05\/1716343366606.png\" alt=\"\" class=\"wp-image-138\" srcset=\"https:\/\/blog.superfyx.top\/wp-content\/uploads\/2024\/05\/1716343366606.png 733w, https:\/\/blog.superfyx.top\/wp-content\/uploads\/2024\/05\/1716343366606-300x147.png 300w\" sizes=\"(max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<p>\u81f3\u6b64\uff0c\u6e90\u7801\u7684\u4e0b\u8f7d\u548c\u7f16\u8bd1\u6210\u529f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u673a\u5668\u914d\u7f6e\u9ad8\u4e00\u70b9\uff0ccpu\u5f3a\u4e00\u70b932\u6838\u8d77\u6b65\u5427\uff0c\u5b58\u50a8\u7a7a\u95f4\u820d\u5f97\u70b9\u7ed9\u4e2a400~500G\u5427 \u6b65\u9aa41\uff1aRepo \u5de5\u5177\u4e0b\u8f7d \u6b65 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[14,16,15],"_links":{"self":[{"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/posts\/127"}],"collection":[{"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":15,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions\/145"}],"wp:attachment":[{"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.superfyx.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}