{"id":51215,"date":"2026-01-28T11:53:15","date_gmt":"2026-01-28T03:53:15","guid":{"rendered":"https:\/\/www.zhidianwl.com\/zhidian\/?p=51215"},"modified":"2026-01-28T11:53:15","modified_gmt":"2026-01-28T03:53:15","slug":"whl-%e6%89%93%e5%8c%85apk%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.com\/zhidian\/2026\/51215\/","title":{"rendered":"whl \u6253\u5305apk\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"<p>WHl\uff08Wheel\uff09\u662fPython\u7684\u4e00\u4e2a\u6253\u5305\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06Python\u7684\u9879\u76ee\u6253\u5305\u6210\u4e00\u4e2a.whl\u6587\u4ef6\uff0c\u65b9\u4fbf\u5728\u5176\u4ed6\u673a\u5668\u4e0a\u5b89\u88c5\u4f7f\u7528\u3002\u800cAPK\u662fAndroid\u5e73\u53f0\u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f\u5305\uff0c\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u8d44\u6e90\u548c\u4ee3\u7801\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528WHl\u6253\u5305APK\u3002<\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u5de5\u5177\uff1a<\/p>\n<p>1. Python 2.7\u6216Python 3.x<\/p>\n<p>2. Android SDK<\/p>\n<p>3. Apache Ant<\/p>\n<p>4. Pyjnius\u548cKivy<\/p>\n<p>Pyjnius\u662f\u4e00\u4e2aPython\u5e93\uff0c\u53ef\u4ee5\u8ba9Python\u4e0eJava\u4e92\u76f8\u8c03\u7528\u3002Kivy<a href=\"https:\/\/www.yimenapp.net\/dabao-1412.html\">h5\u6253\u5305apk\u4f53\u9a8c<\/a>\u662f\u4e00\u4e2aPython\u6846\u67b6\uff0c\u7528\u4e8e\u5f00\u53d1\u591a\u70b9\u89e6\u63a7\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u4f7f\u7528Pyjnius\u548cKivy\u6765\u5f00\u53d1Android\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2aKivy\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u91cc\u4ee5\u4e00\u4e2a\u7b80\u5355\u7684\u201cHello World\u201d\u7a0b\u5e8f\u4e3a\u4f8b\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>from kivy.app import App<\/p>\n<p>from kivy.uix.label import Label<\/p>\n<p>class HelloWorldApp(App):<\/p>\n<p>    def build(self):<\/p>\n<p>        return Label(text=&#8217;Hello, world!&#8217;)<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<\/p>\n<p>    HelloWorldApp().run()<\/p>\n<p>&#8220;`<\/p>\n<p>\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4e0a\u8ff0\u4ee3\u7801\uff0c\u5373\u53ef\u770b\u5230\u4e00\u4e2a\u7b80\u5355\u7684\u201cHello, world!\u201d\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528Pyjnius\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3aJava\u4ee3\u7801\uff0c\u5e76\u5c06Java\u4ee3\u7801\u6253\u5305\u6210\u4e00\u4e2a.jar\u6587\u4ef6\u3002\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>python -m android.toolchain create jni<\/p>\n<p>python -m android.too<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-04\/03\/17\/21045994896.jpg\" \/><\/figure>\n<\/p>\n<p>lchain &#8211;dist-name myapp &#8211;sdk \/path\/to\/android-sdk &#8211;ndk \/path\/to\/android-ndk &#8211;arch armea<a href=\"https:\/\/www.yimenapp.net\/dabao-2213.html\">\u624b\u673a\u6253\u5305apk<\/a>bi-v7a create project &#8211;name myapp &#8211;package org.test.myapp &#8211;activity main &#8211;copy-libs<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0c\/path\/to\/android-sdk\u548c\/path\/to\/android-ndk\u9700\u8981\u66ff\u6362\u4e3a\u5b9e\u9645\u7684Android SDK\u548cAndroid NDK\u7684\u8def\u5f84\u3002\u6267\u884c\u5b8c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3amyapp\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86Java\u4ee3\u7801\u548c\u5176\u4ed6\u5fc5\u8981\u7684\u6587\u4ef6\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528Kivy\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3aAPK\u6587\u4ef6\u3002\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>python -m android.toolchain &#8211;dist-name myapp &#8211;sdk \/path\/to\/android-sdk &#8211;ndk \/path\/to\/android-ndk &#8211;arch armeabi-v7a &#8211;copy-libs build<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u4f1a\u751f\u6210\u4e00\u4e2a\u540d\u4e3amyapp-0.1-debug.apk\u7684\u6587\u4ef6\uff0c\u5373\u4e3a\u6211\u4eec\u6240\u9700\u7684APK\u6587\u4ef6\u3002<\/p>\n<p>\u603b\u7ed3\u6765\u8bf4\uff0c\u4f7f\u7528WHl\u6253\u5305APK\u7684\u8fc7\u7a0b\u4e3b\u8981\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\uff1aPython\u3001Android SDK\u3001Apache Ant\u3001Pyjnius\u548cKivy\u3002<\/p>\n<p>2. \u521b\u5efa\u4e00\u4e2aKivy\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>3. \u4f7f\u7528Pyjnius\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3aJava\u4ee3\u7801\uff0c\u5e76\u5c06Java\u4ee3\u7801\u6253\u5305\u6210\u4e00\u4e2a.jar\u6587\u4ef6\u3002<\/p>\n<p>4. \u4f7f\u7528Kivy\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3aAPK\u6587\u4ef6\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u4f7f\u7528WHl\u6253\u5305APK\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u9700\u8981\u5bf9\u76f8\u5173\u77e5\u8bc6\u6709\u4e00\u5b9a\u7684\u4e86\u89e3\u548c\u5b9e\u8df5\u7ecf\u9a8c\u624d\u80fd\u591f\u987a\u5229\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WHl\uff08Wheel\uff09\u662fPython\u7684\u4e00\u4e2a\u6253\u5305\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06Python\u7684\u9879\u76ee\u6253\u5305\u6210\u4e00\u4e2a.whl\u6587\u4ef6\uff0c\u65b9\u4fbf\u5728\u5176\u4ed6\u673a\u5668\u4e0a\u5b89\u88c5\u4f7f\u7528\u3002\u800cAPK\u662fAndroid\u5e73\u53f0\u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f\u5305\uff0c\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u8d44\u6e90\u548c\u4ee3\u7801<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5481,81,14,171,39474],"class_list":["post-51215","post","type-post","status-publish","format-standard","hentry","category-zuoapp","tag-exe","tag-81","tag-14","tag-171","tag-app"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=51215"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51215\/revisions"}],"predecessor-version":[{"id":51231,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51215\/revisions\/51231"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=51215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=51215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=51215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}