Python/Kivy 应用程序到 Windows 上的 apk - 安装虚拟机后该怎么办? [英] Python/Kivy app to apk on windows - what to do after installing a virtual machine?

查看:25
本文介绍了Python/Kivy 应用程序到 Windows 上的 apk - 安装虚拟机后该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道目前没有办法使用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:

  1. 下载 Kivy Buildozer VM 并解压缩文件.
  2. Oracle VirtualBox 下载区下载适用于您机器的 VirtualBox 版本并安装.
  3. 下载适用于所有平台的 Oracle VM VirtualBox Extension Pack 并安装它.
  4. 启动VirtualBox,点击文件 » 导入设备...
  5. 选择解压后的目录,文件名为Buildozer VM.ovf
  6. 点击设置 » 常规 » 高级并在的下拉列表中选择双向>共享剪贴板:,以及拖放:
  7. 点击设置 » 共享文件夹并点击添加新的共享文件夹.Kivy Apps 文件夹.
  8. 点击设置 » USB,勾选启用USB控制器,勾选USB 2.0 (EHCI)控制器,并单击 添加新的 USB 过滤器 例如宏碁平板电脑.
  1. Download Kivy Buildozer VM and unzip the file.
  2. Download the version of VirtualBox for your machine from Oracle VirtualBox download area and install it.
  3. Download Oracle VM VirtualBox Extension Pack for all platforms and install it.
  4. Start VirtualBox, click on File » Import Appliance...
  5. Select the extracted directory, file named, Buildozer VM.ovf
  6. Click on Settings » General » Advanced and select Bidirectional in the drop-down list for Shared Clipboard:, and Drag'n'Drop:
  7. Click on Settings » Shared Folders and click Adds new shared folder. e.g. Kivy Apps folder.
  8. 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 设置

  1. 下载 PyCharm 社区并安装.
  2. 安装KV Lang Auto-完成和突出显示
  3. 请参考 PyCharm 项目解释器设置

为 Android 创建一个包

  1. 启动VirtualBox,选择Kivy/Buildozer VM并点击Start
  2. 密码是kivy
  3. 将您的 Kivy 应用程序从本地计算机复制到 Home 文件夹中的文件夹.
  4. 双击主文件夹
  5. 双击Kivy App 文件夹
  6. 单击鼠标右键并选择在此处打开终端
  7. 在终端命令提示符下,键入 buildozer init 以创建 buildozer.spec 文件.
  8. 双击buildozer.spec文件进行更改(例如titlepackage.namelog_level = 2) 并保存更改.
  9. 在终端命令提示符下,键入 buildozer android debug deploy run
  10. 享受吧!
  1. Start VirtualBox, select Kivy/Buildozer VM and click Start
  2. Password is kivy
  3. Copy your Kivy App from local machine to a folder in Home folder.
  4. Double click Home folder
  5. Double click Kivy App folder
  6. Right mouse click and select Open Terminal Here
  7. At Terminal command prompt, type buildozer init to create buildozer.spec file.
  8. Double click buildozer.spec file to make changes (e.g. title, package.name, log_level = 2) and save changes.
  9. At Terminal command prompt, type buildozer android debug deploy run
  10. Enjoy!

这篇关于Python/Kivy 应用程序到 Windows 上的 apk - 安装虚拟机后该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆