但是想要在不同的平台使用python代码,还需要将python代码打包成对应平台的可执行程序,好在kivy项目下有个打包工具项目–buildozer,这是官方推荐的打包工具,因为相对比较简单,自动化程度高,其他项目比如:python-for-android 可以通过修改配置文件更改app的名称等,然后运行: buildozer android debug deploy run 运行以上命令将会生成跨平台的安装包,可适用安卓、ios等,如果用于安卓,则是利用python-for-android target] <command>... buildozer --version Available targets: android Android target, based on python-for-android project ios iOS target, based on kivy-ios project android_old Android target, based on python-for-android
但是想要在不同的平台使用python代码,还需要将python代码打包成对应平台的可执行程序,好在kivy项目下有个打包工具项目–buildozer,这是官方推荐的打包工具,因为相对比较简单,自动化程度高,其他项目比如:python-for-android 可以通过修改配置文件更改app的名称等,然后运行: buildozer android debug deploy run 运行以上命令将会生成跨平台的安装包,可适用安卓、ios等,如果用于安卓,则是利用python-for-android target] <command>... buildozer --version Available targets: android Android target, based on python-for-android project ios iOS target, based on kivy-ios project android_old Android target, based on python-for-android
iOS target, based on kivy-ios project android Android target, based on python-for-android platform # Run 'git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android ' # Cwd /home/user/hostcwd/.buildozer/android/platform Cloning into 'python-for-android'... 网络卡了很长一段时间后会弹出众多的报错: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Cloning into 'python-for-android Command failed: git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android
iOS target, based on kivy-ios project android Android target, based on python-for-android platform # Run 'git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android ' # Cwd /home/user/hostcwd/.buildozer/android/platform Cloning into 'python-for-android'... 网络卡了很长一段时间后会弹出众多的报错: Cloning into 'python-for-android'... fatal: unable to access 'https://github.com Command failed: git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android
安装虚拟机 要将 Kivy 编写的图形程序打包为安卓APP,需要使用到 Kivy 编写的 python-for-android 库。