{"id":412,"date":"2025-12-03T15:31:44","date_gmt":"2025-12-03T07:31:44","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=412"},"modified":"2025-12-03T15:31:44","modified_gmt":"2025-12-03T07:31:44","slug":"%e4%bd%bf%e7%94%a8android%e6%a8%a1%e6%8b%9f%e5%99%a8%e8%b0%83%e8%af%95linux%e5%86%85%e6%a0%b8","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/12\/03\/%e4%bd%bf%e7%94%a8android%e6%a8%a1%e6%8b%9f%e5%99%a8%e8%b0%83%e8%af%95linux%e5%86%85%e6%a0%b8\/","title":{"rendered":"\u4f7f\u7528Android\u6a21\u62df\u5668\u8c03\u8bd5linux\u5185\u6838"},"content":{"rendered":"\n<p>\u4e0b\u9762\u6211\u7ed9\u4f60\u4e00\u4efd <strong>\u300c\u4f7f\u7528 Android \u6a21\u62df\u5668\uff08\u6216 Android \u865a\u62df\u673a\uff09\u6765\u8c03\u8bd5 Linux \u5185\u6838\u300d\u7684\u5b8c\u6574\u53ef\u884c\u65b9\u6848\u6307\u5357<\/strong>\u3002\u6ce8\u610f\uff1a<br>\u26a0\ufe0f <strong>\u4e0d\u80fd\u76f4\u63a5\u7528\u666e\u901a Android \u6a21\u62df\u5668\uff08\u5982 BlueStacks\u3001\u96f7\u7535\u3001\u591c\u795e\uff09\u8c03\u8bd5 Linux \u5185\u6838<\/strong> \u2014\u2014 \u5b83\u4eec\u53ea\u662f\u201c\u5e94\u7528\u7ea7\u201d\u865a\u62df\u5316\uff0c\u4e0d\u63d0\u4f9b\u5185\u6838\u7ea7\u8c03\u8bd5\u63a5\u53e3\u3002<br>\u2714\ufe0f <strong>\u4f46\u4f60\u53ef\u4ee5\u4f7f\u7528 AOSP + Android Emulator\uff08\u5b98\u65b9\u6a21\u62df\u5668\uff09\u6216\u4fee\u6539\u5185\u6838\u540e\u91cd\u65b0\u7f16\u8bd1 AOSP \u6765\u8c03\u8bd5\u5185\u6838\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u2705 \u4e00\u3001\u53ef\u884c\u7684\u65b9\u6cd5\u603b\u89c8\uff08\u6309\u53ef\u64cd\u4f5c\u6027\u6392\u5e8f\uff09<\/h1>\n\n\n\n<p><strong>\u6700\u63a8\u8350\uff1a1\u30012<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65b9\u6cd5 1\uff1a\u4f7f\u7528 AOSP + \u5b98\u65b9 Android Emulator \u8c03\u8bd5 Linux \u5185\u6838\uff08\u53ef GDB\uff09<\/strong><\/h3>\n\n\n\n<p>Android \u81ea 5.4+ \u5185\u6838\u5f00\u59cb\uff0c\u5b98\u65b9\u5df2\u7ecf\u652f\u6301 <strong>goldfish<\/strong> \u4e0e <strong>ranchu<\/strong> \u865a\u62df\u5185\u6838\uff0c\u5b98\u65b9\u6a21\u62df\u5668\u53ef\u4ee5\u542f\u52a8\u81ea\u7f16\u8bd1\u7684\u5185\u6838\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2714 \u652f\u6301 GDB \/ KGDB<\/li>\n\n\n\n<li>\u2714 \u652f\u6301\u5185\u6838 log<\/li>\n\n\n\n<li>\u2714 \u4e0d\u9700\u8981\u771f\u673a<\/li>\n\n\n\n<li>\u2714 \u5b98\u65b9\u652f\u6301<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7f16\u8bd1 AOSP \u6bd4\u8f83\u5927\uff08100G+\uff09<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65b9\u6cd5 2\uff1a\u4f7f\u7528 QEMU + Android \u5185\u6838\u6620\u50cf\u8c03\u8bd5\uff08\u6700\u7a33\u5b9a\uff09<\/strong><\/h3>\n\n\n\n<p>Android \u6a21\u62df\u5668\u5e95\u5c42\u672c\u6765\u5c31\u662f QEMU \u7684\u4e00\u4e2a\u5305\u88c5\u3002<br>\u76f4\u63a5\u4f7f\u7528 QEMU \u8fd0\u884c <strong>boot.img + system.img<\/strong><br>\u5373\u53ef\u5bf9\u5185\u6838\u8fdb\u884c <strong>GDB \u8fdc\u7a0b\u8c03\u8bd5<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65b9\u6cd5 3\uff1a\u4f7f\u7528 AVM\uff08Android Virtualization Framework\uff0c\u5b89\u5353\u865a\u62df\u5316\uff09\u8fd0\u884c Linux \u5185\u6838\uff08Android 13+\uff09<\/strong><\/h3>\n\n\n\n<p>Google \u63a8\u51fa\u65b0\u6280\u672f\uff1aAndroid 13 \u53ef\u521b\u5efa\u8f7b\u91cf\u865a\u62df\u673a (Microdroid)<br>\u652f\u6301 <strong>\u8fd0\u884c Linux \u5185\u6838\u5e76\u8c03\u8bd5<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udd27 \u4e8c\u3001\u65b9\u6cd5 1\uff1aAOSP + Android Emulator \u8c03\u8bd5\u81ea\u7f16\u8bd1\u5185\u6838\uff08\u5b98\u65b9\u65b9\u6cd5\uff09<\/h1>\n\n\n\n<p>\u6b64\u65b9\u6cd5\u5b8c\u5168\u4e0d\u9700\u8981\u771f\u673a\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 1\uff1a\u51c6\u5907 AOSP \u6e90\u7801<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nrepo init -u https:\/\/android.googlesource.com\/platform\/manifest -b android-14.0.0_r1\nrepo sync -j16\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 2\uff1a\u83b7\u53d6 Android Emulator \u5185\u6838\u914d\u7f6e<\/strong><\/h2>\n\n\n\n<p>Android \u6a21\u62df\u5668\u4f7f\u7528\u7684\u5185\u6838\u53eb <strong>goldfish<\/strong> \u6216 <strong>ranchu<\/strong>\uff1a<\/p>\n\n\n\n<p>\u8def\u5f84\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\naosp\/kernel\/prebuilt\/common\/x86_64\/\n\n<\/pre><\/div>\n\n\n<p>\u5305\u542b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>bzImage\uff08\u5185\u6838\uff09<\/li>\n\n\n\n<li>ramdisk.img\uff08\u521d\u59cb\u5185\u5b58\u76d8\uff09<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 3\uff1a\u4fee\u6539\u5185\u6838\u5e76\u91cd\u65b0\u7f16\u8bd1<\/strong><\/h2>\n\n\n\n<p>\u4ee5 goldfish \u5185\u6838\u4e3a\u4f8b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncd aosp\/kernel\/goldfish\nmake x86_64_ranchu_defconfig\nmake -j$(nproc)\n\n<\/pre><\/div>\n\n\n<p>\u7f16\u8bd1\u5b8c\u6210\u540e\u5f97\u5230\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\narch\/x86\/boot\/bzImage\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 4\uff1a\u7528 Emulator \u542f\u52a8\u81ea\u7f16\u8bd1\u5185\u6838<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nemulator -kernel out\/compiled_kernel\/arch\/x86\/boot\/bzImage \\\n         -show-kernel \\\n         -verbose \\\n         -qemu -s -S\n\n<\/pre><\/div>\n\n\n<p>\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-qemu -s -S<\/code>\uff1a\u8ba9 QEMU \u6682\u505c\u5e76\u7b49\u5f85 GDB \u8fde\u63a5\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 5\uff1a\u4f7f\u7528 GDB \u8c03\u8bd5\u5185\u6838<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngdb vmlinux\n(gdb) target remote :1234\n(gdb) b start_kernel\n(gdb) c\n\n<\/pre><\/div>\n\n\n<p>\u8fd9\u6837\u4f60\u5c31\u6210\u529f\u5728 Android \u6a21\u62df\u5668\u4e2d\u8c03\u8bd5 Linux \u5185\u6838\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udd27 \u4e09\u3001\u65b9\u6cd5 2\uff1a\u4f7f\u7528 QEMU \u76f4\u63a5\u8fd0\u884c Android \u955c\u50cf\u8c03\u8bd5\u5185\u6838\uff08\u7b80\u5355\u53ef\u9760\uff09<\/h1>\n\n\n\n<p>\u5982\u679c\u4f60\u4e0d\u60f3\u7f16\u8bd1 AOSP\uff0c\u53ea\u60f3\u8c03\u8bd5\u5185\u6838\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u6700\u8f7b\u91cf\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 1\uff1a\u51c6\u5907 Android \u955c\u50cf<\/strong><\/h2>\n\n\n\n<p>\u9700\u8981\u6587\u4ef6\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nkernel (bzImage)\nramdisk.img\nsystem.img\nvendor.img\n\n<\/pre><\/div>\n\n\n<p>\u53ef\u4ee5\u4ece AOSP \u4e0b\u8f7d\u9884\u5efa\u955c\u50cf\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 2\uff1a\u7528 QEMU \u542f\u52a8 Android<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nqemu-system-x86_64 \\\n  -kernel bzImage \\\n  -append &quot;console=ttyS0 root=\/dev\/ram0&quot; \\\n  -initrd ramdisk.img \\\n  -drive file=system.img,format=raw \\\n  -s -S\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u6b65\u9aa4 3\uff1aGDB \u8c03\u8bd5<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngdb vmlinux\n(gdb) target remote :1234\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udd27 \u56db\u3001\u65b9\u6cd5 3\uff1a\u4f7f\u7528 Android 13+ \u7684 AVF \u8fd0\u884c Linux\uff08\u9ad8\u7ea7\uff09<\/h1>\n\n\n\n<p>\u5982\u679c\u4f60\u4f7f\u7528 Pixel + Android 13<br>\ud83d\udc47<br>\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a Mini Linux VM\uff08Microdroid\uff09\uff0c\u5e76\u5728 VM \u5185\u8c03\u8bd5 Linux \u5185\u6838\u3002<\/p>\n\n\n\n<p>Google \u6587\u6863\uff1a<br>&#8220;Android Virtualization Framework&#8221;<\/p>\n\n\n\n<p>\u8fd9\u662f\u6700\u5148\u8fdb\u7684\u65b9\u6cd5\uff0c\u4f46\u914d\u7f6e\u7565\u590d\u6742\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udcdd \u4e94\u3001\u5982\u679c\u4f60\u53ea\u662f\u60f3\u201c\u5728 Android \u4e0a\u8fd0\u884c Linux \u5e76\u8c03\u8bd5\u7a0b\u5e8f\u201d<\/h1>\n\n\n\n<p>\u5982\u679c\u4f60\u5e76\u975e\u201c\u8c03\u8bd5 Android kernel\u201d\uff0c\u800c\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728 Android \u6a21\u62df\u5668\u4e0a\u8dd1 Linux<\/li>\n\n\n\n<li>\u8c03\u8bd5 Linux \u7528\u6237\u6001\u7a0b\u5e8f<\/li>\n<\/ul>\n\n\n\n<p>\u5219\u66f4\u7b80\u5355\uff1a<\/p>\n\n\n\n<p>\u5b89\u88c5 UserLAnd \/ PRoot Linux\uff08Ubuntu\u3001Debian \u7b49\uff09<br>\u2192 \u7136\u540e\u5728 Linux \u91cc\u8c03\u8bd5\u7528\u6237\u7a7a\u95f4\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>\u4f46\u6ce8\u610f\uff1a<br>\u274c <strong>\u4e0d\u80fd\u8c03\u8bd5 Android \u7684\u5e95\u5c42\u5185\u6838<\/strong><br>\u53ea\u80fd\u8c03\u8bd5 Linux \u7528\u6237\u6001\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83c\udfaf \u4f60\u9002\u5408\u54ea\u79cd\uff1f<\/h1>\n\n\n\n<p>\u544a\u8bc9\u6211\u4f60\u662f\u54ea\u79cd\u9700\u6c42\uff0c\u6211\u53ef\u4ee5\u76f4\u63a5\u7ed9\u4f60\u5177\u4f53\u547d\u4ee4\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u4f60\u662f\u60f3\u8c03\u8bd5 <strong>Android \u81ea\u5df1\u7684 Linux \u5185\u6838<\/strong>\uff1f<\/h3>\n\n\n\n<p>\u2192 \u9009\u65b9\u6cd5 1 \u6216 2<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u4f60\u53ea\u662f\u60f3\u5728 Android \u4e0a\u8dd1 Linux \u7a0b\u5e8f\uff1f<\/h3>\n\n\n\n<p>\u2192 \u7528 PRoot \/ Termux \u66f4\u5feb<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3\ufe0f\u20e3 \u4f60\u8981\u5b66\u4e60 Kernel \u8c03\u8bd5\uff1f<\/h3>\n\n\n\n<p>\u2192 \u6211\u53ef\u4ee5\u7ed9\u4f60 <strong>\u6700\u7b80\u5316\u7684 Linux \u5185\u6838\u8c03\u8bd5\u73af\u5883<\/strong>\uff08QEMU + GDB\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u6211\u7ed9\u4f60\u4e00\u4efd \u300c\u4f7f\u7528 Android \u6a21\u62df\u5668\uff08\u6216 Android \u865a\u62df\u673a\uff09\u6765\u8c03&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/12\/03\/%e4%bd%bf%e7%94%a8android%e6%a8%a1%e6%8b%9f%e5%99%a8%e8%b0%83%e8%af%95linux%e5%86%85%e6%a0%b8\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-12"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=412"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":413,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/412\/revisions\/413"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}