问题描述
我知道目前没有办法使用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 - 安装虚拟机后该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!