問題描述
我知道目前沒有辦法使用windows為android打包一個kivy應用程序,所以我下載了一個Linux虛擬機.但是然后呢?我還沒有為初學者找到一個很好的分步教程來解釋整個過程.
I understand that currently there is no way to package a kivy app for android using windows, so I have downloaded a Linux virtual machine. But then what? I haven't found a good step-by-step tutorial for beginners explaining the whole process.
我是否應該將 Python、PyCharm、Kivy 等下載到虛擬機中,并將所有應用程序文件復制到其中?如果是這樣,那之后的下一步是什么?很抱歉這么無知,但我是編碼和應用程??序開發的新手,主要從在線教程中學習.任何意見是極大的贊賞!
Am I supposed to download Python, PyCharm, Kivy, etc. into the virtual machine, and also copy the all the app files into it? And if so, what's the next step after that? Sorry to be so clueless, but I'm new to coding and app development, and learning mostly from online tutorials. Any advice is greatly appreciated!
推薦答案
您可以通過以下操作在 Windows 上打包 Kivy Apps for Android:
You can package Kivy Apps for Android on Windows by doing the following:
- 下載 Kivy Buildozer VM 并解壓縮文件.
- 從 Oracle VirtualBox 下載區下載適用于您機器的 VirtualBox 版本并安裝.
- 下載適用于所有平臺的 Oracle VM VirtualBox Extension Pack 并安裝它.
- 啟動VirtualBox,點擊文件 ? 導入設備...
- 選擇解壓后的目錄,文件名為Buildozer VM.ovf
- 點擊設置 ? 常規 ? 高級并在的下拉列表中選擇雙向>共享剪貼板:,以及拖放:
- 點擊設置 ? 共享文件夾并點擊添加新的共享文件夾.Kivy Apps 文件夾.
- 點擊設置 ? USB,勾選啟用USB控制器,勾選USB 2.0 (EHCI)控制器,并單擊 添加新的 USB 過濾器 例如宏碁平板電腦.
- Download Kivy Buildozer VM and unzip the file.
- Download the version of VirtualBox for your machine from Oracle VirtualBox download area and install it.
- Download Oracle VM VirtualBox Extension Pack for all platforms and install it.
- Start VirtualBox, click on File ? Import Appliance...
- Select the extracted directory, file named, Buildozer VM.ovf
- Click on Settings ? General ? Advanced and select Bidirectional in the drop-down list for Shared Clipboard:, and Drag'n'Drop:
- Click on Settings ? Shared Folders and click Adds new shared folder. e.g. Kivy Apps folder.
- Click on Settings ? USB, check Enable USB Controller, checkbox USB 2.0 (EHCI) Controller, and click Adds new USB filters e.g. Acer tablet.
PyCharm IDE 設置
- 下載 PyCharm 社區并安裝.
- 安裝KV Lang Auto-完成和突出顯示
- 請參考 PyCharm 項目解釋器設置一個>
為 Android 創建一個包
- 啟動VirtualBox,選擇Kivy/Buildozer VM并點擊Start
- 密碼是kivy
- 將您的 Kivy 應用程序從本地計算機復制到 Home 文件夾中的文件夾.
- 雙擊主文件夾
- 雙擊Kivy App 文件夾
- 單擊鼠標右鍵并選擇在此處打開終端
- 在終端命令提示符下,鍵入
buildozer init
以創建 buildozer.spec 文件. - 雙擊buildozer.spec文件進行更改(例如title、package.name、log_level = 2) 并保存更改.
- 在終端命令提示符下,鍵入
buildozer android debug deploy run
- 享受吧!
- Start VirtualBox, select Kivy/Buildozer VM and click Start
- Password is kivy
- Copy your Kivy App from local machine to a folder in Home folder.
- Double click Home folder
- Double click Kivy App folder
- Right mouse click and select Open Terminal Here
- At Terminal command prompt, type
buildozer init
to create buildozer.spec file. - Double click buildozer.spec file to make changes (e.g. title, package.name, log_level = 2) and save changes.
- At Terminal command prompt, type
buildozer android debug deploy run
- Enjoy!
這篇關于Python/Kivy 應用程序到 Windows 上的 apk - 安裝虛擬機后該怎么辦?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!