\u5b89\u5353app<\/a>uments “-DQt5Qml_DIR=\/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Qml”<\/p>\n arguments “-DQt5Svg_DIR=\/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Svg”<\/p>\n
arguments “-DQt5Xml_DIR=\/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Xml”<\/p>\n
arguments “-DQt5Widgets_DIR=\/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Widgets”<\/p>\n
arguments “-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON”<\/p>\n
}<\/p>\n
}<\/p>\n
}<\/p>\n
“`<\/p>\n
\u7136\u540e\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684 CMakeLists.txt \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u4ee5\u96c6\u6210 Qt \u5e93\uff1a<\/p>\n
“`<\/p>\n
set(Qt5Common_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Common)<\/p>\n
set(Qt5Widgets_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Widgets)<\/p>\n
set(Qt5Gui_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Gui)<\/p>\n
set(Qt5Network_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Network)<\/p>\n
set(Qt5Core_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Core)<\/p>\n
set(Qt5Test_DIR \/Users\/xxx\/PyQt5\/5.15.4\/clang_64\/lib\/cmake\/Qt5Test)<\/p>\n
…<\/p>\n
find_package(Qt5 COMPONENTS Core Gui Network Widgets REQUIRED)<\/p>\n
…<\/p>\n
target_link_libraries(<\/p>\n
${target}<\/p>\n
Qt5::Core<\/p>\n
Qt5::Gui<\/p>\n
Qt5::Network<\/p>\n
Qt5::Widgets<\/p>\n
)<\/p>\n
“`<\/p>\n
4. \u6253\u5305\u5e76\u8fd0\u884c<\/p>\n
\u5728 Android Studio \u4e2d\uff0c\u4f7f\u7528 Build > Make Project \u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\u3002<\/p>\n
\u7136\u540e\uff0c\u5728\u7ec8\u7aef\u4e2d\uff0c\u8fdb\u5165\u5de5\u7a0b\u76ee\u5f55\u4e0b\u7684 app\/build\/intermediates\/cmake\/debug\/obj\/arm64-v8a \u76ee\u5f55\u3002\u5c06 pyuic5 \u751f\u6210\u7684 .pyc \u6587\u4ef6\u548c\u5de5\u7a0b\u4ee3\u7801\u6587\u4ef6\u62f7\u8d1d\u5230\u6b64\u76ee\u5f55\u4e0b\u3002<\/p>\n
\u5728\u7ec8\u7aef\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u9879\u76ee\u6253\u5305\u6210 APK \u6587\u4ef6\uff1a<\/p>\n
“`<\/p>\n
adb shell “export LD_LIBRARY_PATH=\/data\/local\/tmp && \/data\/local\/tmp\/python3.8 .py”<\/p>\n
“`<\/p>\n
\u4f7f\u7528 adb \u547d\u4ee4\u5c06 APK \u6587\u4ef6\u5b89\u88c5\u5230 Android \u8bbe\u5907\u4e0a\uff1a<\/p>\n
“`<\/p>\n
adb install <\/p>\n","protected":false},"excerpt":{"rendered":"
PyQt5 \u662f Python \u8bed\u8a00\u4e0b\u7684\u4e00\u6b3e GUI \u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u5f00\u53d1\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u540c\u65f6\uff0cPyQt5 \u8fd8\u53ef\u4ee5\u6253\u5305\u6210 Android \u5e94\u7528\uff0c\u5e76\u5728 Android \u5e73\u53f0\u4e0a\u8fd0\u884c\u3002\u5236\u4f5c\u5b89\u5353\u5e94\u7528\u4e3b\u8981\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,23269,171,23270,3640],"class_list":{"0":"post-16693","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-zuoapp","7":"tag-81","8":"tag-app","9":"tag-171","11":"tag-3640"},"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16693","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\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=16693"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16693\/revisions"}],"predecessor-version":[{"id":16698,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/16693\/revisions\/16698"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=16693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=16693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=16693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}