{"id":976,"date":"2015-10-25T08:34:40","date_gmt":"2015-10-25T08:34:40","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=976"},"modified":"2026-02-08T09:40:00","modified_gmt":"2026-02-08T09:40:00","slug":"build-skia-for-android","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2015\/10\/build-skia-for-android\/","title":{"rendered":"\u72ec\u7acb\u7f16\u8bd1 Skia for Android"},"content":{"rendered":"<p>\u6700\u8fd1\u60f3\u4e86\u89e3\u4e0b <a href=\"https:\/\/skia.org\">Skia<\/a> \u76f8\u5173\u7684\u4e1c\u897f\uff0c\u60f3\u5229\u7528\u5176\u4e2d\u7684\u4e00\u4e9b API \u6765\u505a\u505a\u4f18\u5316\uff0c\u6240\u4ee5\u6253\u7b97\u72ec\u7acb\u7f16\u8bd1\u4e00\u4e2a\u7248\u672c\u8bd5\u8bd5\u770b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhttps:\/\/skia.org\/user\/quick\/android\n<\/pre>\n<p>\u4f7f\u7528\u7684\u4ee3\u7801\u7248\u672c<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncommit 81bdbf8bed8b739c2b65ac576e89d0258276e6dc\nAuthor: caryclark &lt;caryclark@google.com&gt;\nDate:   Wed Oct 21 04:16:19 2015 -0700\n<\/pre>\n<p>\u7f16\u8bd1\u73af\u5883<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nUbuntu 14.04.2\n<\/pre>\n<p>\u76f4\u63a5\u6309\u7167\u5b98\u65b9\u8bf4\u660e\u5c31\u53ef\u4ee5\u7f16\u8bd1\u51fa\u6765\uff0c\u6211\u8fd9\u91cc\u662f\u4e0d\u60f3\u53bb\u4e0b\u8f7d\u4e00\u904d NDK\uff0c\u6240\u4ee5\u8fdb\u884c\u4e86\u70b9\u6539\u52a8\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhttp:\/\/dl.google.com\/android\/ndk\/android-ndk-r10e-linux-x86_64.bin\n<\/pre>\n<p>\u5982\u679c\u673a\u5668\u4e0a\u5df2\u7ecf\u5b89\u88c5\u8fc7\u5bf9\u5e94\u7248\u672c\u7684 NDK\uff0c\u53ef\u4ee5\u4fee\u6539\u4ee5\u4e0b\u6587\u4ef6\u76f4\u63a5\u751f\u6210 TOOLCHAIN(\u8fd9\u4e2a\u6b65\u9aa4\u4e0d\u662f\u5fc5\u987b\u7684)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/mnt\/extra\/skia\/platform_tools\/android\/bin\/utils\/setup_toolchain.sh\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n function default_toolchain() {\n-  TOOLCHAINS=${SCRIPT_DIR}\/..\/toolchains\n+  TOOLCHAINS=\/home\/ubuntu\/dev\n \n   ANDROID_ARCH=${ANDROID_ARCH-arm}\n   LLVM=3.6\n@@ -50,19 +50,13 @@ function default_toolchain() {\n   exportVar ANDROID_TOOLCHAIN &quot;${TOOLCHAINS}\/${TOOLCHAIN}\/bin&quot;\n \n   if &#x5B; ! -d &quot;$ANDROID_TOOLCHAIN&quot; ]; then\n-    mkdir -p $TOOLCHAINS\n     pushd $TOOLCHAINS\n-    curl -o $NDK.bin https:\/\/dl.google.com\/android\/ndk\/android-ndk-$NDK-$HOST-x86_64.bin\n-    chmod +x $NDK.bin\n-    .\/$NDK.bin -y\n     .\/android-ndk-$NDK\/build\/tools\/make-standalone-toolchain.sh \\\n         --arch=$ANDROID_ARCH    \\\n         --llvm-version=$LLVM    \\\n         --platform=android-$API \\\n         --install_dir=$TOOLCHAIN\n     cp android-ndk-$NDK\/prebuilt\/android-$ANDROID_ARCH\/gdbserver\/gdbserver $TOOLCHAIN\n-    rm $NDK.bin\n-    rm -rf android-ndk-$NDK\n     popd\n   fi\n<\/pre>\n<p>\u751f\u6210\u8fc7\u4e00\u6b21 TOOLCHAIN \u4e4b\u540e\u4e5f\u53ef\u4ee5\u628a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nexport ANDROID_TOOLCHAIN=\/home\/ubuntu\/dev\/arm-r10e-14\/bin\nexport PATH=$ANDROID_TOOLCHAIN:$PATH\n<\/pre>\n<p>\u624b\u52a8\u52a0\u5728\u5230\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u53bb(\u8fd9\u4e2a\u6b65\u9aa4\u4e0d\u662f\u5fc5\u987b\u7684)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n.\/platform_tools\/android\/bin\/android_ninja -d nexus_5\n<\/pre>\n<p>\u7136\u540e\u5c31\u662f\u7b49\u5f85\u7f16\u8bd1\uff0c\u5982\u679c\u4e2d\u9014\u7f16\u8bd1 APK \u7684\u65f6\u5019\u5374\u5c11\u4e00\u4e9b\u7279\u5b9a\u7248\u672c\u7684 Build Tool \u7684\u65f6\u5019\u4fee\u6539\u4e0b App \u5f53\u4e2d\u4f7f\u7528\u7248\u672c\u5c31\u597d\u4e86\uff0c\u6216\u8005\u4e5f\u53ef\u4ee5\u53bb\u66f4\u65b0\u4ee3\u7801\u5f53\u4e2d\u5bf9\u5e94\u7684\u7248\u672c<br \/>\nApp \u4ee3\u7801\u4f4d\u4e8e<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/mnt\/extra\/skia\/platform_tools\/android\/apps\/\n<\/pre>\n<p>\u7f16\u8bd1\u5b8c\u6210\u4e4b\u540e\u5c31\u53ef\u4ee5\u5728<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/mnt\/extra\/skia\/out\/config\/android-nexus_5\/Debug\n<\/pre>\n<p>\u4e0b\u770b\u5230 so \u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u60f3\u4e86\u89e3\u4e0b Skia \u76f8\u5173\u7684\u4e1c\u897f\uff0c\u60f3\u5229\u7528\u5176\u4e2d\u7684\u4e00\u4e9b API \u6765\u505a\u505a\u4f18\u5316\uff0c\u6240\u4ee5\u6253\u7b97\u72ec\u7acb\u7f16\u8bd1\u4e00\u4e2a\u7248\u672c\u8bd5\u8bd5\u770b\u3002 https:\/\/skia.org\/user\/quick\/android \u4f7f\u7528\u7684\u4ee3\u7801\u7248\u672c commit 81bdbf8bed8b739c2b65ac576e89d0258276e6dc Author: caryclark &lt;caryclark@google.com&gt; Date: Wed Oct 21 04:16:19 2015 -0700 \u7f16\u8bd1\u73af\u5883 Ubuntu 14.04.2 \u76f4\u63a5\u6309\u7167\u5b98\u65b9\u8bf4\u660e\u5c31\u53ef\u4ee5\u7f16\u8bd1\u51fa\u6765\uff0c\u6211\u8fd9\u91cc\u662f\u4e0d\u60f3\u53bb\u4e0b\u8f7d\u4e00\u904d NDK\uff0c\u6240\u4ee5\u8fdb\u884c\u4e86\u70b9\u6539\u52a8\u3002 http:\/\/dl.google.com\/android\/ndk\/android-ndk-r10e-linux-x86_64.bin \u5982\u679c\u673a\u5668\u4e0a\u5df2\u7ecf\u5b89\u88c5\u8fc7\u5bf9\u5e94\u7248\u672c\u7684 NDK\uff0c\u53ef\u4ee5\u4fee\u6539\u4ee5\u4e0b\u6587\u4ef6\u76f4\u63a5\u751f\u6210 TOOLCHAIN(\u8fd9\u4e2a\u6b65\u9aa4\u4e0d\u662f\u5fc5\u987b\u7684) \/mnt\/extra\/skia\/platform_tools\/android\/bin\/utils\/setup_toolchain.sh function default_toolchain() { &#8211; TOOLCHAINS=${SCRIPT_DIR}\/..\/toolchains + TOOLCHAINS=\/home\/ubuntu\/dev ANDROID_ARCH=${ANDROID_ARCH-arm} LLVM=3.6 @@ -50,19 +50,13 @@ function default_toolchain() { exportVar ANDROID_TOOLCHAIN &quot;${TOOLCHAINS}\/${TOOLCHAIN}\/bin&quot; if &#x5B; ! -d &quot;$ANDROID_TOOLCHAIN&quot; ]; then &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2015\/10\/build-skia-for-android\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u72ec\u7acb\u7f16\u8bd1 Skia for Android<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-976","post","type-post","status-publish","format-standard","hentry","category-android","category-misc"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=976"}],"version-history":[{"count":6,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/976\/revisions"}],"predecessor-version":[{"id":1055,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/976\/revisions\/1055"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}