{"id":30272,"date":"2024-07-29T11:55:44","date_gmt":"2024-07-29T03:55:44","guid":{"rendered":"https:\/\/www.zhidianwl.net\/zhidianwl\/?p=30272"},"modified":"2024-07-29T11:55:44","modified_gmt":"2024-07-29T03:55:44","slug":"%e5%a6%82%e6%9e%9c%e6%8a%8aapk%e8%bd%ac%e6%8d%a2%e6%88%90aab%e8%a6%81%e6%80%8e%e4%b9%88%e5%81%9a%e5%91%a2","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.net\/zhidianwl\/2024\/07\/29\/%e5%a6%82%e6%9e%9c%e6%8a%8aapk%e8%bd%ac%e6%8d%a2%e6%88%90aab%e8%a6%81%e6%80%8e%e4%b9%88%e5%81%9a%e5%91%a2\/","title":{"rendered":"\u5982\u679c\u628aapk\u8f6c\u6362\u6210aab\u8981\u600e\u4e48\u505a\u5462?"},"content":{"rendered":"

APK\u548cAAB\u662fAndroid\u5e94\u7528\u7a0b\u5e8f\u7684\u4e24\u79cd\u4e0d\u540c\u7684\u683c\u5f0f\u3002APK\u662fAndroidjar\u8f6capk\u7f51\u7ad9<\/a>\u5e94\u7528\u7a0b\u5e8f\u5305\u7684\u6807\u51c6\u683c\u5f0f\uff0c\u800cAAB\u662fAndroid\u5e94\u7528\u7a0b\u5e8f\u6346\u7ed1\u5305\u7684\u683c\u5f0f\u3002AAB\u662fpython\u6253\u5305\u6210apk\u6587\u4ef6<\/a>\u4e00\u79cd\u65b0\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u5b83\u662fGoogle Play\u5546\u5e97\u63a8\u51fa\u7684\u4e00\u9879\u65b0\u529f\u80fd\uff0c\u7528\u4e8e\u4f18\u5316\u5e94\u7528\u7a0b\u5e8f\u7684\u4ea4\u4ed8\u548c\u5b89\u88c5\u3002<\/p>\n

AAB\u6587\u4ef6\u683c\u5f0f\u5305\u542b\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u7ec4\u4ef6\uff0c\u5305\u62ec\u4ee3\u7801\u3001\u8d44\u6e90\u3001\u5e93\u3001\u914d\u7f6e\u6587\u4ef6\u548c\u5176\u4ed6\u6587\u4ef6\u3002\u4e0eAPK\u4e0d\u540c\uff0cAAB\u6587\u4ef6\u683c\u5f0f\u4e0d\u5305\u542b\u7f16\u8bd1\u540e\u7684DEX\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u53ea\u5728\u5e94<\/p>\n

<\/figure>\n<\/p>\n

\u7528\u7a0b\u5e8f\u5b89\u88c5\u65f6\u751f\u6210\u3002\u8fd9\u610f\u5473\u7740AAB\u6587\u4ef6\u683c\u5f0f\u6bd4APK\u6587\u4ef6\u683c\u5f0f\u66f4\u5c0f\uff0c\u66f4\u5feb\u901f\u5730\u4e0b\u8f7d\u548c\u5b89\u88c5\u3002<\/p>\n

\u4e3a\u4e86\u5c06APK\u8f6c\u6362\u6210AAB\uff0c\u9700\u8981\u4f7f\u7528Google\u63d0\u4f9b\u7684\u5de5\u5177\u201cbundletool\u201d\u3002Bundletool\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06APK\u8f6c\u6362\u6210AAB\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u5305\u542b\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7ec4\u4ef6\u7684AAB\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u5c06APK\u8f6c\u6362\u4e3aAAB\u7684\u6b65\u9aa4\uff1a<\/p>\n

1. \u4e0b\u8f7d\u5e76\u5b89\u88c5bundletool<\/p>\n

Bundletool\u662f\u4e00\u4e2aJava\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u4eceGoogle\u7684\u5f00\u53d1\u8005\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u3002\u6309\u7167\u6307\u793a\u5b89\u88c5bundletool\u5e76\u786e\u4fdd\u5b83\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002<\/p>\n

2. \u521b\u5efaAPK\u6587\u4ef6<\/p>\n

\u5728\u5c06APK\u8f6c\u6362\u4e3aAAB\u4e4b\u524d\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2aAPK\u6587\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528Android Studio\u6216Gradle\u6765\u521b\u5efaAPK\u6587\u4ef6\u3002\u786e\u4fddAPK\u6587\u4ef6\u662f\u6709\u6548\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002<\/p>\n

3. \u4f7f\u7528bundletool\u8f6c\u6362APK\u4e3aAAB<\/p>\n

\u8981\u5c06APK\u8f6c\u6362\u4e3aAAB\uff0c\u8bf7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

bundletool build-apks –bundle=\/path\/to\/your\/app.aab –output=\/path\/to\/output.apks<\/p>\n

\u5728\u8fd9\u4e2a\u547d\u4ee4\u4e2d\uff0c\u201c–bundle\u201d\u53c2\u6570\u6307\u5b9a\u8981\u8f6c\u6362\u7684AAB\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u201c–output\u201d\u53c2\u6570\u6307\u5b9a\u8f93\u51faAPKS\u6587\u4ef6\u7684\u8def\u5f84\u3002APKS\u6587\u4ef6\u662f\u5305\u542b\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7ec4\u4ef6\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002<\/p>\n

4. \u5b89\u88c5APKS\u6587\u4ef6<\/p>\n

\u8981\u5b89\u88c5APKS\u6587\u4ef6\uff0c\u8bf7\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

adb install-multiple \/path\/to\/output.apks<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5c06APKS\u6587\u4ef6\u5b89\u88c5\u5230\u8bbe\u5907\u4e0a\uff0c\u5e76\u5728\u8bbe\u5907\u4e0a\u751f\u6210\u4e00\u4e2a\u65b0\u7684APK\u6587\u4ef6\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

\u5c06APK\u8f6c\u6362\u4e3aAAB\u53ef\u4ee5\u51cf\u5c11\u6587\u4ef6\u5927\u5c0f\uff0c\u52a0\u5feb\u5e94\u7528\u7a0b\u5e8f\u7684\u4ea4\u4ed8\u548c\u5b89\u88c5\u901f\u5ea6\u3002\u4f7f\u7528bundletool\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06APK\u8f6c\u6362\u4e3aAAB\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u5305\u542b\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u7ec4\u4ef6\u7684APKS\u6587\u4ef6\u3002\u5728\u8bbe\u5907\u4e0a\u5b89\u88c5APKS\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u5728\u8bbe\u5907\u4e0a\u751f\u6210\u4e00\u4e2a\u65b0\u7684APK\u6587\u4ef6\uff0c\u7528\u4e8e\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

APK\u548cAAB\u662fAndroid\u5e94\u7528\u7a0b\u5e8f\u7684\u4e24\u79cd\u4e0d\u540c\u7684\u683c\u5f0f\u3002APK\u662fAndroid\u5e94\u7528\u7a0b\u5e8f\u5305\u7684\u6807\u51c6\u683c\u5f0f\uff0c\u800cAAB\u662fAndroid\u5e94\u7528\u7a0b\u5e8f\u6346\u7ed1\u5305\u7684\u683c\u5f0f\u3002AAB\u662f\u4e00\u79cd\u65b0\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u5b83\u662fGoogle Play<\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27321,27320,116,12,338],"topic":[],"class_list":["post-30272","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-playcover-ipa","tag-apk","tag-116","tag-12","tag-338"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=30272"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30272\/revisions"}],"predecessor-version":[{"id":30276,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30272\/revisions\/30276"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=30272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=30272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=30272"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=30272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}