1設置試験
(1)
安装CMD> conda activate python36
CMD> pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
CMD> pip install kivy.deps.gstreamer
CMD> pip install kivy
CMD> pip install kivy_examples
(2)举例
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello,kivy')
TestApp().run()
実行後の出力
[INFO ] [Logger ] Record log in C:\Users\user\.kivy\logs\kivy_21-02-07_37.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.3.1
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "D:\Anaconda3\envs\python36\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 15:18:16) [MSC v.1916 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "D:\Anaconda3\envs\python36\python.exe"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <b'4.6.0 - Build 26.20.100.8141'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) UHD Graphics 620'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60 - Build 26.20.100.8141'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Leaving application in progress...
2携帯電話apkとしてパッケージ化[さまざまなマイナーな問題]
2.1インストールツール
python-for-android:以降p4aと呼びますが、Kivyが公式に推奨しているパッケージ方法です。
WSL:これは、WindowsのLinuxサブシステムであるLinux用のWindowsサブシステムです。新しいバージョンのWin10をインストールできます。さらに、WSLはファイルシステムをメインのWindowsシステムと共有しているため、ファイルのコピーが非常に便利です。
2.1.1WindowsでのLinuxサブシステムWSL
(1)Windows機能の有効化または無効化
まず、検索バーで「Windows機能の有効化または無効化」を検索して開き、「WindowsサブシステムforLinux」の項目をチェックします。この設定が有効になっている場合にのみ、WSLを正常にインストールできます。
(2)WSLをインストールします
下载地址列表【https://www.jianshu.com/p/8a62c020a553】。
如下下载ubuntu18.04。
https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu_1804.2019.522.0_x64.appx
如下下载ubuntu18.04 arm。
https://wsldownload.azureedge.net/Ubuntu_1804.2018.726.0_ARM.appx
または、Microsoftストアから検索してインストールします
(3)ダウンロードが完了したら、直接ダブルクリックして
インストールできます。インストールが完了すると、インストールしたLinuxディストリビューションがスタートメニューに表示されます。ここでは、すべてのLinuxディストリビューションがWindowsアプリケーションです。
ユーザー名とパスワードをphone / bigdataに設定します。
$ sudo passwd rootは、パスワードbigdataを変更します。
$ lsb_release -c【Codename: focal】
$ uname -a
Linux 2SBT3Z2 4.4.0-18362-Microsoft #1049-Microsoft Thu Aug 14 12:01:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
Windows
C:\ Users \ user \ AppData \ Local \ Packagings \ CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc \ LocalState \ rootfsでWSLファイルの場所
を表示するLinuxで他のパーティションを表示する場合、WSLは/ mntの下に他のドライブ文字をマウントします。
(4)ソース
$ sudo vim / etc / apt / sources.listを更新します
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
18.04バイオニック
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
python3【3.6.7】
更新とアップグレード
$ sudo apt-get update
$ sudo apt-get upgrade
2.1.2buildozerの依存関係をインストールする
(1)Buildozerはp4aに基づいています
sudo apt-get install git zip unzip python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev lld
(2)python3-pipの国内ソースを設定します
$ mkdir〜 / .pip
$ vim〜 / .pip /pip.conf
ファイルの内容を次のように編集します
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
(3)Cythonのインストールp4aは特定のバージョンに依存することに注意してください
$ pip3 install --upgrade Cython == 0.29.21 virtualenv
2.1.3p4aをインストールします
(1)p4aの依存関係
URL https://python-for-android.readthedocs.io/en/latest/quickstart/をインストールして、依存関係を表示します。
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git zlib1g-dev python3 python3-dev libncurses5:i386 libstdc++6:i386 zlib1g:i386 unzip ant ccache autoconf libtool libssl-dev
Package…がまだ設定されていないというエラーがある場合、上記のコマンドでの解決策は次のとおりです。
sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/
sudo mkdir /var/lib/dpkg/info/
sudo apt-get update
sudo apt-get -f install
エラーが報告されていない場合は、次のコマンドを実行します
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/
sudo rm -rf /var/lib/dpkg/info
sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info
sudo apt-get update
(2)
p4aをインストールします$ pip3 install python-for-android
2.1.4 Android SDK / NDKをインストールします
SDK / NDKのバージョンに注意してください。推奨バージョンをインストールしてください
(1)SDKを
ダウンロードするAndroid-SDKを次のWebページにダウンロードし、C:\ Users \ user \ Desktopフォルダー
https://developer.android.googleに配置します。 .cn / studio?hl = zh-cn#downloadsFile
namecommandlinetools-linux-6858069_latest.zip (2)NDKをダウンロードします
Android-NDKをダウンロードして、C:\ Users \ user \ Desktopフォルダーに配置します。公式バージョンにはバージョンr19bが必要です。r19bダウンロードリンクを直接クリックできます:https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip?hl = zh_cn
(3)インストール
$ mkdir ~/androidsdk
$ cd ~/androidsdk/
$ unzip /mnt/c/Users/user/Desktop/commandlinetools-linux-6858069_latest.zip
$ mkdir ~/Android
$ cd ~/Android
$ mkdir SDK
$ unzip /mnt/c/Users/user/Desktop/android-ndk-r19b-linux-x86_64.zip
(4)cmdline-toolsをデプロイします
$ cd ~/androidsdk/cmdline-tools/bin
$ ./sdkmanager --sdk_root=$HOME/Android/SDK "cmdline-tools;latest"
(5)環境変数
$ vi〜 / .bashrcを追加します
export ANDROID_SDK_ROOT="$HOME/Android/SDK"
export PATH=$PATH:~/.local/bin/:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/:$ANDROID_SDK_ROOT/tools/:$ANDROID_SDK_ROOT/platform-tools/
export ANDROIDSDK="$HOME/Android/SDK"
export ANDROIDNDK="$HOME/Android/android-ndk-r19b"
export ANDROIDAPI="27" # Target API version of your application
export NDKAPI="21" # Minimum supported API version of your application
$ rm -rf androidsdk /
Ctrl + Dの前にzipファイルが解凍されたsdkフォルダーを削除してウィンドウを閉じ、Ubuntuを再度開きます
2.1.5APIプラットフォームとビルドツールをインストールします
APIプラットフォームをインストールします。推奨されるAPIレベルは27です。
$ sdkmanager "platforms; android-27"
$ sdkmanager "build-tools; 29.0.0"
は、インストールできるビルドツールのすべてのバージョンを一覧表示できます
$ sdkmanager --list | grep build-tools
2.1.6jdkをインストールします
$ sudo apt-get remove openjdk *アップロード自带的openjdk
$ cp /mnt/c/Users/user/Desktop/jdk-8u181-linux-x64.tar.gz / home / phone
$ tar -xzvf jdk-8u181-linux -x64.tar.gz -C / home / phone
$ sudo ln -s /home/phone/jdk1.8.0_181/bin/java / usr / bin / java
2.2パッケージ化および使用
アプリケーションをビルドするには、名前、バージョン、パッケージ識別子、使用するブートストラップ(kivyまたはsdl2アプリの場合はsdl2)、および要件を指定する必要があります。
2.2.1プロジェクトの作成
$ mkdir〜
/ helloworld
$ cd〜/ helloworld $ vi main.py
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello,kivy')
TestApp().run()
2.2.2パッケージングコマンド
$ p4a apk --private $ HOME / helloworld --package = org.example.myapp --name“ My application” --version 0.1 --bootstrap = sdl2 --requirements = python3、kivy == 2.0.0
注意が必要はい-private $ HOME / helloworldは、プロジェクトが配置されているフォルダーを指定します。
ダウンロードしたファイルの場所は、C:\ Users \ user \ AppData \ Local \ Packages \ CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc \ LocalState \ rootfs \ home \ phone.local \ share \ python-for-android \ packagesです。
https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgzからhostpython3をダウンロードする
SDL2_image-2.0.4.tar.gz
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
$ sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
$ sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
$ sudo apt-get install libssl-dev openssl
$ sudo apt-get install libffi-dev
$ sudo apt-get update
$ sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
$ sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
$ sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
$ sudo apt-get install libssl-dev openssl
$ sudo apt-get install libffi-dev
$ sudo apt-get install libxpm-dev libxext-dev
$ sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev
Cython.Compiler.Errors.InternalError:内部コンパイラエラー: 'config.pxi'が見つかりません
コンパイルされたソフトウェアは、このディレクトリにある
/home/phone/.local/share/python-for-android/build/other_builds。
あなたが再パッケージ化する場合は、すべてのダウンロードとビルドコンテンツをクリアするには、次のコマンドを使用することができます。
P4Aのclean_all
だけならば内部をクリーンアップする依存関係の再ダウンロードを回避するには、次のコマンドを実行します
。p4aclean_builds && p4a clean_dists
2.2.3テスト
私のコンピューターでは、Windowsエクスプローラーを使用して
C:\ Users \ user \ AppData \ Local \ Packages \ CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc \ LocalState \ rootfs \ home \ phoneに
アクセスすると、apkファイルが表示されます。ディレクトリの場所は異なる場合があります。ただし、apkファイル名を検索すると、対応する場所をいつでも見つけることができます。
apkファイルを電話にコピーして実行し、インストールします...インストールされているHelloWorldソフトウェアが電話の画面に表示されます。
クリックして実行します。
2.3異常と解決策
(1)ubuntu configure:エラー:Cコンパイラは実行可能ファイルを作成できません
$ sudo apt-get install clang && rvm install 1.9.3 --with-gcc = clang
$ sudo apt-get install build-essential
$ sudo apt-get install- build-essential
$ sudo apt-get install --reinstall gcc
$ sudo dpkg-reconfigure build-essential
$ sudo dpkg-reconfigure gcc
$ sudo apt install gobjc ++
(2)無法安装Kivy(Windows 10、python 3.8)
$ p4aapk-を再インストールします。 -private $ HOME / helloworld --package = org.example.myapp --name“ My application” --version 0.1 --bootstrap = sdl2 --requirements = python3、kivy
未指定kivy的版本、默认下ダウンロードkivy-1.11。 1有问题。
$ p4a apk --private $ HOME / helloworld --package = org.example.myapp --name“ My application” --version 0.1 --bootstrap = sdl2 --requirements = python3、kivy == 2.0.0
最新のKivy安定版はPython3.8をサポートしており、正常に動作します
3システムミラーを使用する[成功]
Pyファイルをapkファイルにパッケージ化するには、次の3つの方法があります。
(1)Buildozerを使用します(Linux環境で実装されているため、統合フレームワークの方が実装が簡単です)。
(2)python for androidを介して(これはWindowsで実現できますが、多くのコンテンツをインストールして構成する必要があり、より面倒です)。
(3)Kivy Launcherを介したパッケージ(Googleマーケットが必要です。ネットワークの観点から、他のものを選択することをお勧めします)。
3.1仮想マシンイメージ
(1)virtualboxをインストールします。
(2)
解凍後にイメージファイルLXLE14.04.3(32bit).vdi.zipをダウンロードします。サイズは10Gです。
(3)Virtualboxは新しい仮想マシンを作成します。linux
とubuntu 32bitを選択し、既存のイメージを選択します。
(4)オペレーティングシステムの
ユーザー名とパスワードosboxes.org/osboxes.org
3.1.1ubuntu構成ネットワークカード
(1)ネットワークカード情報の表示
#ifconfig [eth0]
(2)ネットワークカードファイルの構成
virtualboxブリッジネットワークカード
vi / etc / network / interfaces
デフォルトのコンテンツは次のとおりです。
auto lo
iface lo inet loopback
動的IPはに設定されています
auto eth0
iface eth0 inet dhcp
dns-nameservers 223.5.5.5
3.2Buildozerを使用したパッケージ化
$ cd〜 / Desktop / kivycodeはこのディレクトリで動作します。
3.2.1buildozer.specファイル
cdコマンドを使用して、パッケージ化するプロジェクトの同じレベルのディレクトリに入り、次のコマンドを実行します。
$ buildozer init
これにより、プロジェクトの同じレベルのディレクトリにbuildozer.specファイルが生成されます。このファイルを使用して、パッケージ化されたアプリ(アプリ名、アイコン、バージョンなどを含む)を構成します。
[app]
# 应用名称(笔者改为“ImportV”)
title = ImportV
# 包名(App故障排除时会用到)
package.name = myapp
# 域名(App故障排除时会用到)
package.domain = org.test
# main.py文件所在位置(由于该配置文件与项目在同级目录,故默认为“.”)
source.dir = .
# 需要打包进来的文件的扩展名
source.include_exts = py,png,jpg,kv,atlas
# 不需要打包进来的文件的扩展名
#source.include_patterns = assets/*,images/*.png
# 不需要打包进来的文件的扩展名
#source.exclude_exts = spec
# 排除的目录
#source.exclude_dirs = tests, bin
# 排除的列表
#source.exclude_patterns = license,images/*/*.jpg
# 应用的版本(写法一)
version = 0.1
# 应用的版本(写法二)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py
# 需安装的依赖包(很重要!!!大部分打包出来的App闪退就是因为有依赖包没有打包进来)
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy
# 自定义源文件
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
# 通过Garden安装包
#garden_requirements =
# 预加载的图片文件(修改时需要把前面的“#”删掉)
#presplash.filename = %(source.dir)s/data/presplash.png
# 应用图标(修改时需要把前面的“#”删掉),笔者修改为项目中images文件夹下的icon.png
icon.filename = %(source.dir)s/images.icon.png
# 应用支持的方向(landscape, sensorLandscape, portrait 或者 all)
orientation = portrait
# 声明的服务列表
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
#
# OSX 配置(Android打包不需理会)
#
#
# author = © Copyright Info
# change the major version of python used by the app
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
#
# Android 配置
#
# 全屏显示设为1,非全屏显示设为0
fullscreen = 0
# 预加载的颜色
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF
# 申请的权限
#android.permissions = INTERNET
# 支持的Android API版本,越高兼容性越好
#android.api = 27
# 支持最低的Android API版本,越低越好
#android.minapi = 21
# 使用的Android SDK版本
#android.sdk = 20
# 使用的Android NDK版本
#android.ndk = 19b
# 支持的最低的Android NDK API版本
#android.ndk_api = 21
# 使用私有储存(True)或者公有储存(False)
#android.private_storage = True
# Android NDK路径(为空将自动下载)
#android.ndk_path =
# Android SDK路径(为空将自动下载)
#android.sdk_path =
# ANT路径(为空将自动下载)
#android.ant_path =
# 是否跳过更新Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False
# 是否自动接收SDK协议
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False
# 默认入口
#android.entrypoint = org.renpy.android.PythonActivity
# Android应用程序的主题,默认适用于kivy开发的应用程序
# android.apptheme = "@android:style/Theme.NoTitleBar"
# 项目白名单
#android.whitelist =
# 白名单路径
#android.whitelist_src =
# 黑名单路径
#android.blacklist_src =
# 添加的Android jar包
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
# 使用的Java文件
# directory containing the files)
#android.add_src =
# 添加Android AAR文档(目前只适用于sdl2_gradle 和 bootstrap)
#android.add_aars =
# 添加Gradle依赖(目前只适用于sdl2_gradle 和 bootstrap)
#android.gradle_dependencies =
# 添加java编译选项
# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
# see https://developer.android.com/studio/write/java8-support for further information
# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"
# Gradle存储库添加(对于某些android.gradle_dependencies可能是必需的)
# please enclose in double quotes
# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =
# 要添加的打包选项
# see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
# can be necessary to solve conflicts in gradle_dependencies
# please enclose in double quotes
# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_gradle_repositories =
# 添加的Java类
#android.add_activities = com.example.ExampleActivity
# 控制台类别,应设置为GAME 或者 APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
# 控制台图标文件,必须是732x412 的png图片
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
# XML 文件过滤器
#android.manifest.intent_filters =
# 设置启动模式为主活动
#android.manifest.launch_mode = standard
# Android附加库复制进 libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_arm64_v8a = libs/android-v8/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so
# 屏幕是否常亮
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False
# Android应用程序元数据设置(key=value format)
#android.meta_data =
# 要添加的Android库
#android.library_references =
# Android共享库添加
#android.uses_library =
# Android日志过滤
#android.logcat_filters = *:S python:D
# 用复制库取代生成的libpymodules.so
#android.copy_libs = 1
# 主要后构建的Android框架,可选项: armeabi-v7a, arm64-v8a, x86, x86_64
android.arch = armeabi-v7a
# 覆盖版本计算(在build.gradle中使用)
# this is not the same as app version and should only be edited if you know what you're doing
# android.numeric_version = 1
#
# Python for android 配置
#
# 使用python-for-android fork分支,默认为upstream (kivy)
#p4a.fork = kivy
# 使用python-for-android branch分支,默认为master
#p4a.branch = master
# Python-for-Android下载路径,为空默认为从git下载
#p4a.source_dir =
# 本地的构建方法
#p4a.local_recipes =
# p4a相关文件
#p4a.hook =
# 用于构建Android的Bootstrap
# p4a.bootstrap = sdl2
# P4a端口号
#p4a.port =
#
# iOS 配置(Android打包不必理会)
#
# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master
# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.7.0
# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"
# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s
[buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer
# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin
# -----------------------------------------------------------------------------
# List as sections
#
# You can define all the "list" as [section:key].
# Each line will be considered as a option to the list.
# Let's take [app] / source.exclude_patterns.
# Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
# This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#
# -----------------------------------------------------------------------------
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(demo)" in the name
# and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
# Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug
3.2.2パッケージング
$ buildozer android debug deploy run
このコマンドは、同じレベルのディレクトリのbinフォルダーにapkファイルのデバッグバージョンを生成します。最初のパッケージ化プロセスでは、多くの依存関係とパッケージをインストールする必要があり、合意に同意する必要があります。
パッケージングが完了したら、apkファイルをAndroidスマートフォンにインストールし、インストール後に開きます。