{"id":10588,"date":"2023-11-29T12:00:15","date_gmt":"2023-11-29T04:00:15","guid":{"rendered":"https:\/\/www.zhidianwl.net\/zhidianwl\/?p=10588"},"modified":"2023-11-29T12:00:15","modified_gmt":"2023-11-29T04:00:15","slug":"apks-%e8%bd%acapk%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.net\/zhidianwl\/2023\/11\/29\/apks-%e8%bd%acapk%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d\/","title":{"rendered":"apks \u8f6capk\u5e38\u89c4\u64cd\u4f5c\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"

APKS\u662fAndroid App Bundle\u7684\u7f29\u5199\uff0c\u662fGoogle\u57282018\u5e74\u53d1\u5e03\u7684\u4e00\u79cd\u65b0\u7684\u5e94\u7528\u7a0b\u5e8f\u5206\u53d1\u683c\u5f0f\u3002APKS\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u5185\u5bb9\uff08\u5305\u62ec\u8bed\u8a00\u3001\u5c4f\u5e55\u5bc6\u5ea6\u3001CPU\u67b6\u6784\u7b49\uff09\u6253\u5305\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u9002\u5e94\u4e0d\u540c\u7684\u8bbe\u5907\u3002<\/p>\n

\u7136\u800c\uff0c\u7531\u4e8e\u4e00\u4e9b\u539f\u56e0\uff08\u4f8b\u5982\u8bbe\u5907\u4e0d\u652f\u6301APKS\u683c\u5f0f\u3001\u9700\u8981\u5355\u72ec\u5b89\u88c5\u67d0\u4e9b\u7ec4\u4ef6\u7b49\uff09\uff0c\u6709\u65f6\u5019\u7528\u6237\u9700\u8981\u5c06APKS\u683c\u5f0f\u7684\u5e94\u7528\u8f6c\u6362\u6210APK\u683c\u5f0f\u3002\u4e0b\u9762\u5c06\u4ecb\u7ecd\u4e24\u79cd\u5e38\u89c1\u7684\u8f6c\u6362\u65b9\u5f0f\u3002<\/p>\n

1.\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177bundletool<\/p>\n

bundletool\u662fGoogle\u63d0\u4f9b\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u3001\u7b7e\u540d\u548c\u9a8c\u8bc1Android App apk<\/a>Bundle\u6587\u4ef6\u3002bundletool\u8fd8\u652f\u6301\u5c06APKS\u683c\u5f0f\u7684\u5e94\u7528\u8f6c\u6362\u4e3aAPK\u683c\u5f0f\u3002<\/p>\n

\u9996\u5148\uff0c\u9700\u8981\u4eceGoogle\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0a\u4e0b\u8f7dbundletool\u7684\u6700\u65b0\u7248\u672c\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u5c06bundletool.jar\u6587\u4ef6\u653e\u7f6e\u5728\u5408\u9002\u7684\u6587\u4ef6\u5939\u4e2d\uff0c\u7136\u540e\u6253\u5f00\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

java -jar bundletool.jar build-apks –bundle=app.aab –output=app.apks<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0c–bundle\u53c2\u6570\u6307\u5b9a\u8981\u8f6c\u6362\u7684APK\u5e94\u7528\u7a0b\u5e8f\u5305\uff0c–output\u53c2\u6570\u6307\u5b9a\u8f6c\u6362\u540e\u7684APKS\u6587\u4ef6\u7684\u8f93\u51fa\u8def\u5f84\u3002<\/p>\n

\u8f6c\u6362\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u518d\u628aapp\u7684\u6570\u636e\u6253\u5305\u6210apk<\/a>\u6b21\u4f7f\u7528bundletool\u5c06APKS\u6587\u4ef6\u8f6c\u6362\u4e3aAPK\u6587\u4ef6\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

java -jar bundletool.jar extract-apks –apks=app.apks –output-dir=apks-files –device-spec=devices.json<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0c–apks\u53c2\u6570\u6307\u5b9a\u8981\u8f6c\u6362\u7684APKS\u6587\u4ef6\uff0c–output-dir\u53c2\u6570\u6307\u5b9a\u8f6c\u6362\u540eAPK\u6587\u4ef6\u7684\u8f93\u51fa\u8def\u5f84\uff0c–device-spec\u53c2\u6570\u6307\u5b9a\u76ee\u6807\u8bbe\u5907\u7684\u89c4\u8303\u3002devices.json\u662f\u4e00\u4e2aJSON\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u76ee\u6807\u8bbe\u5907\u7684\u4fe1\u606f\uff0c\u4f8b\u5982\u8bbe\u5907\u7684\u5c4f\u5e55\u5bc6\u5ea6\u3001CPU\u67b6\u6784\u7b49\u3002<\/p>\n

2.\u4f7f\u7528\u5728\u7ebf\u8f6c\u6362\u5de5\u5177<\/p>\n

\u9664\u4e86\u4f7f\u7528bundletool\uff0c\u8fd8\u53ef<\/p>\n

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

\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5728\u7ebf\u8f6c\u6362\u5de5\u5177\u5c06APKS\u683c\u5f0f\u7684\u5e94\u7528\u8f6c\u6362\u4e3aAPK\u683c\u5f0f\u3002\u8fd9\u4e9b\u5de5\u5177\u901a\u5e38\u975e\u5e38\u7b80\u5355\u6613\u7528\uff0c\u53ea\u9700\u8981\u4e0a\u4f20APKS\u6587\u4ef6\uff0c\u7136\u540e\u7b49\u5f85\u8f6c\u6362\u5b8c\u6210\u5373\u53ef\u3002<\/p>\n

\u7136\u800c\uff0c\u7531\u4e8e\u5b89\u5168\u548c\u9690\u79c1\u95ee\u9898\uff0c\u5efa\u8bae\u4f7f\u7528\u5b98\u65b9\u6216\u4fe1\u8a89\u826f\u597d\u7684\u5728\u7ebf\u8f6c\u6362\u5de5\u5177\u3002\u540c\u65f6\uff0c\u7531\u4e8e\u8f6c\u6362\u8fc7\u7a0b\u9700\u8981\u4e0a\u4f20\u548c\u4e0b\u8f7d\u5927\u91cf\u6570\u636e\uff0c\u56e0\u6b64\u9700\u8981\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u7a33\u5b9a\u548c\u901f\u5ea6\u8f83\u5feb\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

APKS\u662f\u4e00\u79cd\u65b0\u7684\u5e94\u7528\u7a0b\u5e8f\u5206\u53d1\u683c\u5f0f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u9002\u5e94\u4e0d\u540c\u7684\u8bbe\u5907\u3002\u4f46\u662f\uff0c\u6709\u65f6\u5019\u9700\u8981\u5c06APKS\u683c\u5f0f\u7684\u5e94\u7528\u8f6c\u6362\u4e3aAPK\u683c\u5f0f\u3002\u53ef\u4ee5\u4f7f\u7528bundletool\u6216\u5728\u7ebf\u8f6c\u6362\u5de5\u5177\u6765\u5b8c\u6210\u8f6c\u6362\u3002\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u65b9\u5f0f\uff0c\u90fd\u9700\u8981\u786e\u4fdd\u6570\u636e\u7684\u5b89\u5168\u548c\u7f51\u7edc\u8fde\u63a5\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

APKS\u662fAndroid App Bundle\u7684\u7f29\u5199\uff0c\u662fGoogle\u57282018\u5e74\u53d1\u5e03\u7684\u4e00\u79cd\u65b0\u7684\u5e94\u7528\u7a0b\u5e8f\u5206\u53d1\u683c\u5f0f\u3002APKS\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u5185\u5bb9\uff08\u5305\u62ec\u8bed\u8a00\u3001\u5c4f\u5e55\u5bc6\u5ea6\u3001CPU\u67b6\u6784\u7b49\uff09\u6253\u5305\u6210\u4e00\u4e2a\u6587\u4ef6<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[12097,12,47,16497,140],"topic":[],"class_list":["post-10588","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-12097","tag-12","tag-47","tag-ua","tag-140"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10588","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\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=10588"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10588\/revisions"}],"predecessor-version":[{"id":10617,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10588\/revisions\/10617"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=10588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=10588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=10588"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=10588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}