RUN__IT # pycharm设置

这篇博客详细介绍了PyCharm的各种快捷键和设置,包括编辑、查找/替换、运行、调试、导航、搜索相关、重构、版本控制、模版、基本设置等多个方面,帮助用户提高开发效率。此外,还提到了如何导入和导出设置,以及如何配置Python环境、编码、字体大小等。

pycharm常用快捷键

1、编辑(Editing)

Ctrl + Space 基本的代码完成(类、方法、属性)
Ctrl + Alt + Space 快速导入任意类
Ctrl + Shift + Enter 语句完成
Ctrl + P 参数信息(在方法中调用参数)

Ctrl + Q 快速查看文档

F1 外部文档

Shift + F1 外部文档,进入web文档主页

Ctrl + Shift + Z --> Redo 重做

Ctrl + 鼠标 简介/进入代码定义
Ctrl + F1 显示错误描述或警告信息
Alt + Insert 自动生成代码
Ctrl + O 重新方法
Ctrl + Alt + T 选中
Ctrl + / 行注释/取消行注释
Ctrl + Shift + / 块注释
Ctrl + W 选中增加的代码块
Ctrl + Shift + W 回到之前状态
Ctrl + Shift + ]/[ 选定代码块结束、开始
Alt + Enter 快速修正
Ctrl + Alt + L 代码格式化
Ctrl + Alt + O 优化导入
Ctrl + Alt + I 自动缩进
Tab / Shift + Tab 缩进、不缩进当前行
Ctrl+X/Shift+Delete 剪切当前行或选定的代码块到剪贴板
Ctrl+C/Ctrl+Insert 复制当前行或选定的代码块到剪贴板
Ctrl+V/Shift+Insert 从剪贴板粘贴
Ctrl + Shift + V 从最近的缓冲区粘贴
Ctrl + D 复制选定的区域或行
Ctrl + Y 删除选定的行
Ctrl + Shift + J 添加智能线
Ctrl + Enter 智能线切割
Shift + Enter 另起一行
Ctrl + Shift + U 在选定的区域或代码块间切换
Ctrl + Delete 删除到字符结束
Ctrl + Backspace 删除到字符开始
Ctrl + Numpad+/- 展开/折叠代码块(当前位置的:函数,注释等)
Ctrl + shift + Numpad+/- 展开/折叠所有代码块
Ctrl + F4 关闭运行的选项卡
2、查找/替换(Search/Replace)
F3 下一个
Shift + F3 前一个
Ctrl + R 替换
Ctrl + Shift + F 或者连续2次敲击shift 全局查找{可以在整个项目中查找某个字符串什么的,如查找某个函数名字符串看之前是怎么使用这个函数的}
Ctrl + Shift + R 全局替换
3、运行(Running)
Alt + Shift + F10 运行模式配置
Alt + Shift + F9 调试模式配置
Shift + F10 运行
Shift + F9 调试
Ctrl + Shift + F10 运行编辑器配置
Ctrl + Alt + R 运行manage.py任务
4、调试(Debugging)
F8 跳过
F7 进入
Shift + F8 退出
Alt + F9 运行游标
Alt + F8 验证表达式
Ctrl + Alt + F8 快速验证表达式
F9 恢复程序
Ctrl + F8 断点开关
Ctrl + Shift + F8 查看断点
5、导航(Navigation)
Ctrl + N 跳转到类
Ctrl + Shift + N 跳转到符号
Alt + Right/Left 跳转到下一个、前一个编辑的选项卡
F12 回到先前的工具窗口
Esc 从工具窗口回到编辑窗口
Shift + Esc 隐藏运行的、最近运行的窗口
Ctrl + Shift + F4 关闭主动运行的选项卡
Ctrl + G 查看当前行号、字符号
Ctrl + E 当前文件弹出,打开最近使用的文件列表
Ctrl+Alt+Left/Right 后退、前进
Ctrl+Shift+Backspace 导航到最近编辑区域
Alt + F1 查找当前文件或标识
Ctrl+B / Ctrl+Click 跳转到声明
Ctrl + Alt + B 跳转到实现
Ctrl + Shift + I查看快速定义
Ctrl + Shift + B跳转到类型声明
Ctrl + U跳转到父方法、父类
Alt + Up/Down跳转到上一个、下一个方法
Ctrl + ]/[跳转到代码块结束、开始
Ctrl + F12弹出文件结构
Ctrl + H类型层次结构
Ctrl + Shift + H方法层次结构
Ctrl + Alt + H调用层次结构
F2 / Shift + F2下一条、前一条高亮的错误
F4 / Ctrl + Enter编辑资源、查看资源
Alt + Home显示导航条F11书签开关
Ctrl + Shift + F11书签助记开关
Ctrl + #[0-9]跳转到标识的书签
Shift + F11显示书签
6、搜索相关(Usage Search)
Alt + F7/Ctrl + F7文件中查询用法
Ctrl + Shift + F7文件中用法高亮显示
Ctrl + Alt + F7显示用法
7、重构(Refactoring)
F5复制F6剪切
Alt + Delete安全删除
Shift + F6重命名
Ctrl + F6更改签名
Ctrl + Alt + N内联
Ctrl + Alt + M提取方法
Ctrl + Alt + V提取属性
Ctrl + Alt + F提取字段
Ctrl + Alt + C提取常量
Ctrl + Alt + P提取参数
8、控制VCS/Local History
Ctrl + K提交项目
Ctrl + T更新项目
Alt + Shift + C查看最近的变化
Alt + BackQuote(’)VCS快速弹出
9、模版(Live Templates)
Ctrl + Alt + J当前行使用模版
Ctrl +J插入模版
10、基本(General)
Alt + #[0-9]打开相应的工具窗口
Ctrl + Alt + Y同步
Ctrl + Shift + F12最大化编辑开关
Alt + Shift + F添加到最喜欢
Alt + Shift + I根据配置检查当前文件
Ctrl + BackQuote(’)快速切换当前计划
Ctrl + Alt + S 打开设置页
Ctrl + Shift + A查找编辑器里所有的动作

Ctrl + Tab在窗口间进行切换

pycharm常用设置
lz提示一下,pycharm中的设置是可以导入和导出的,file>export settings可以保存当前pycharm中的设置为jar文件,重装时可以直接import settings>jar文件,就不用重复配置了。

file -> Setting ->Editor

  1. 设置Python自动引入包,要先在 >general > autoimport -> python :show popup

    快捷键:Alt + Enter: 自动添加包

  2. “代码自动完成”时间延时设置

Code Completion -> Auto code completion in (ms):0 -> Autopopup in (ms):500

  1. Pycharm中默认是不能用Ctrl+滚轮改变字体大小的,可以在〉Mouse中设置

  2. 显示“行号”与“空白字符”

Appearance -> 勾选“Show line numbers”、“Show whitespaces”、“Show method separators”

  1. 设置编辑器“颜色与字体”主题

Colors & Fonts -> Scheme name -> 选择"monokai"“Darcula”

说明:先选择“monokai”,再“Save As”为"monokai-pipi",因为默认的主题是“只读的”,一些字体大小颜色什么的都不能修改,拷贝一份后方可修改!

修改字体大小

Colors & Fonts -> Font -> Size -> 设置为“14”

  1. 设置缩进符为制表符“Tab”

File -> Default Settings -> Code Style

-> General -> 勾选“Use tab character”

-> Python -> 勾选“Use tab character”

-> 其他的语言代码同理设置

  1. 去掉默认折叠

Code Folding -> Collapse by default -> 全部去掉勾选

  1. pycharm默认是自动保存的,习惯自己按ctrl + s 的可以进行如下设置:

    General -> Synchronization -> Save files on frame deactivation 和 Save files automatically if application is idle for … sec 的勾去掉

    Editor Tabs -> Mark modified tabs with asterisk 打上勾

9.>file and code template>python scripts

#!/usr/bin/env python

-- coding: utf-8 --

“”"
title = ‘KaTeX parse error: Expected group after '_' at position 15: Package_name' _̲_author__ = 'USER’
mtime = ‘$DATE’

code is far away from bugs with the god animal protecting

I love animals. They taste delicious.
          ┏┓      ┏┓
        ┏┛┻━━━┛┻┓
        ┃      ☃      ┃
        ┃  ┳┛  ┗┳  ┃
        ┃      ┻      ┃
        ┗━┓      ┏━┛
            ┃      ┗━━━┓
            ┃  神兽保佑    ┣┓
            ┃ 永无BUG!   ┏┛
            ┗┓┓┏━┳┓┏┛
              ┃┫┫  ┃┫┫
              ┗┻┛  ┗┻┛

“”"

10 python文件默认编码

File Encodings> IDE Encoding: UTF-8;Project Encoding: UTF-8;

  1. 代码自动整理设置

这里line breaks去掉√,否则bar, 和baz会分开在不同行,不好看。

File -> Settings -> appearance

  1. 修改IDE快捷键方案

Keymap

  1. execute selection in console : add keymap > ctrl + enter

系统自带了好几种快捷键方案,下拉框中有如“defaul”,“Visual Studio”,在查找Bug时非常有用,“NetBeans 6.5”,“Default for GNOME”等等可选项,

因为“Eclipse”方案比较大众,个人用的也比较多,最终选择了“Eclipse”。

还是有几个常用的快捷键跟Eclipse不一样,为了能修改,还得先对Eclipse方案拷贝一份:

(1).代码提示功能,默认是【Ctrl+空格】,现改为跟Eclipse一样,即【Alt+/】

Main menu -> code -> Completion -> Basic -> 设置为“Alt+/”

Main menu -> code -> Completion -> SmartType -> 设置为“Alt+Shift+/”

不过“Alt+/”默认又被

Main menu -> code -> Completion -> Basic -> Cyclic Expand Word 占用,先把它删除再说吧(单击右键删除)!

(2).关闭当前文档,默认是【Ctrl+F4】,现改为跟Eclipse一样,即【Ctrl+W】

Main menu -> Window -> Active Tool Window -> Close Active Tab -> 设置为 “Ctrl+F4”;

Main menu -> Window -> Editor -> Close -> 设置为 “Ctrl+W”;

2.设置IDE皮肤主题

Theme -> 选择“Alloy.IDEA Theme”

或者在setting中搜索theme可以改变主题,所有配色统一改变

File > settings > build.excution

每次打开python控制台时自动执行代码

console > pyconsole

import sys

print(‘Python %s on %s’ % (sys.version, sys.platform))

sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
import os
print('current workdirectory : ', os.getcwd() )
import numpy as np
import scipy as sp
import matplotlib as mpl
如果安装了ipython,则在pyconsole中使用更强大的ipython

console

选中use ipython if available

这样每次打开pyconsole就会打开ipython

Note: 在virtualenv中安装ipython: (ubuntu_env) pika:/media/pika/files/mine/python_workspace/ubuntu_env$pip install ipython

File > settings > Languages & Frameworks

如果在项目设置中开启了django支持,打开python console时会自动变成打开django console,当然如果不想这样就关闭项目对django的支持:

如果打开支持就会在 settings > build.excution > console下多显示一个django console:

Django console设置如下

import sys
print(‘Python %s on %s’ % (sys.version, sys.platform))
import django
print(‘Django %s’ % django.get_version())
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
if ‘setup’ in dir(django): django.setup()
import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)

File > settings > Project : initial project

project dependencies > LDA > project depends on these projects > 选择sim_cluster就可以在LDA中调用sim_cluster中的包

pycharm环境和路径配置
python解释器路径
python项目解释器路径
用于配置python项目执行的python路径

比如,有的项目是运行的是系统python2.7下的环境;有的是3.4;有的项目使用的是virtualenv的python环境[python虚拟环境配置 - pycharm中的项目配置]

在pycharm > file > settings > project:pythonworkspace > project interpreter > 选择对应项目 > project interpreter中指定python解释器

pycharm中运行configuration有一个选项add content roots to pythonpath

选中后sys.path中会多一整个项目project的路径/media/pika/files/mine/python_workspace,里面的目录就被当成包使用,这样就可以通过from SocialNetworks.SocialNetworks引入不是python包的目录中的文件了。

不过最好使用sys.path.append(os.path.join(os.path.split(os.path.realpath(file))[0],"…/…"))来添加,这样在pycharm外也可以运行不出错 。

pycharm中进行python包管理
pycharm中的项目中可以包含package、目录(目录名可以有空格)、等等

目录的某个包中的某个py文件要调用另一个py文件中的函数,首先要将目录设置为source root,这样才能从包中至上至上正确引入函数,否则怎么引入都出错:

SystemError: Parent module ‘’ not loaded, cannot perform relative import

Note:目录 > 右键 > make directory as > source root

python脚本解释路径
ctrl + shift + f10 / f10 执行python脚本时

当前工作目录cwd为run/debug configurations 中的working directory

可在edit configurations > project or defaults中配置

console执行路径和当前工作目录
python console中执行时

cwd为File > settings > build.excution > console > pyconsole中的working directory

并可在其中配置

pycharm配置os.environ环境
pycharm中os.environ不能读取到terminal中的系统环境变量

pycharm中os.environ不能读取.bashrc参数

使用pycharm,无论在python console还是在module中使用os.environ返回的dict中都没有/.bashrc中的设置的变量,但是有/etc/profile中的变量配置。然而在terminal中使用python,os.environ却可以获取/.bashrc的内容。

解决方法1:

在~/.bashrc中设置的系统环境只能在terminal shell下运行Spark程序才有效,因为.bashrc is only read for interactive shells.

如果要在当前用户整个系统中都有效(包括pycharm等等IDE),就应该将系统环境变量设置在~/.profile文件中。如果是设置所有用户整个系统,修改/etc/profile或者/etc/environment吧。

如SPARK_HOME的设置[Spark:相关错误总结 ]

解决方法2:在代码中设置,这样不管环境有没有问题了

spark environment settings

import sys, os
os.environ[‘SPARK_HOME’] = conf.get(SECTION, ‘SPARK_HOME’)
sys.path.append(os.path.join(conf.get(SECTION, ‘SPARK_HOME’), ‘python’))
os.environ[“PYSPARK_PYTHON”] = conf.get(SECTION, ‘PYSPARK_PYTHON’)
os.environ[‘SPARK_LOCAL_IP’] = conf.get(SECTION, ‘SPARK_LOCAL_IP’)
os.environ[‘JAVA_HOME’] = conf.get(SECTION, ‘JAVA_HOME’)
os.environ[‘PYTHONPATH’] = ‘SPARKHOME/python/lib/py4j−0.10.3−src.zip:SPARK_HOME/python/lib/py4j-0.10.3-src.zip:SPARKHOME/python/lib/py4j0.10.3src.zip:PYTHONPATH’
pycharm配置第三方库代码自动提示

Pycharm实用拓展功能
pycharm中清除已编译.pyc中间文件
选中你的workspace > 右键 > clean python compiled files

还可以自己写一个清除代码

pycharm设置外部工具
[python小工具 ]针对当前pycharm中打开的py文件对应的目录删除其中所有的pyc文件。如果是直接运行(而不是在下面的tools中运行),则删除E:\mine\python_workspace\WebSite目录下的pyc文件。

将上面的删除代码改成外部工具
PyCharm > settings > tools > external tools > +添加

Name: DelPyc

program: PyInterpreterDirectoryPyInterpreterDirectoryPyInterpreterDirectory/python Python安装路径

Parameters: ProjectFileDirProjectFileDirProjectFileDir/Oth/Utility/DelPyc.py FileDirFileDirFileDir

Work directory: FileDirFileDirFileDir

Note:Parameters后面的 FileDirFileDirFileDir参数是说,DelPyc是针对当前pycharm中打开的py文件对应的目录删除其中所有的pyc文件。

之后可以通过下面的方式直接执行

Note:再添加一个Tools名为DelPycIn

program: Python安装路径,e.g. D:\python3.4.2\python.exe

Parameters: E:\mine\python_workspace\Utility\DelPyc.py

Work directory 使用变量 FileDirFileDirFileDir

参数中没有FileDirFileDirFileDir,这样就可以直接删除常用目录r’E:\mine\python_workspace\WebSite’了,两个一起用更方便

代码质量
当你在打字的时候,PyCharm会检查你的代码是否符合PEP8。它会让你知道,你是否有太多的空格或空行等等。如果你愿意,你可以配置PyCharm运行pylint作为外部工具。

python2转python3最快方式
/usr/bin/2to3 -wn FileDirFileDirFileDir

这样在pycharm中打开某个文件,右键external tools > py2topy3就可以瞬间将当前文件所在目录下的所有py2转换成py3,是不是很机智!

设置默认编码为utf-8

file–default settings-(搜索’encoding’,然后全部修改成utf-8)

python程序头部设置:

file–setting-editor-file and code templates -python script ‘中写入括号里的头部’ (

#!/usr/bin/python

-- coding:utf-8 --

)
通过鼠标滚轮调字体大小
file- settings - editor-general-输入’mouse’搜索- 选中’change font size(zoom) with ctrl + mouse wheel’

第五步:编辑 buildozer.spec 文件 打开 buildozer.spec 文件,修改以下内容:我把我原始的给你,你直接给我全部修改完输出全代码,我目前的全代码是[app] # (str) Title of your application title = My Kivy App # (str) Package name package.name = mykivyapp # (str) Package domain (needed for android/ios packaging) package.domain = org.test # (str) Source code where the main.py live source.dir = . # (str) Main filename source.filename = 1.py # (list) Source files to include (let empty to include all the files) source.include_exts = py,png,jpg,kv,atlas # (list) List of inclusions using pattern matching #source.include_patterns = assets/*,images/*.png # (list) Source files to exclude (let empty to not exclude anything) #source.exclude_exts = spec # (list) List of directory to exclude (let empty to not exclude anything) #source.exclude_dirs = tests, bin, venv # (list) Exclusions using pattern matching #source.exclude_patterns = license,images/*/*.jpg # (str) Application versioning (method 1) version = 0.1 # (str) Application versioning (method 2) # version.regex = __version__ = [&#39;"](.*)[&#39;"] # version.filename = %(source.dir)s/main.py # (list) Application requirements # comma separated e.g. requirements = sqlite3,kivy requirements = python3,kivy,requests,numpy # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes # requirements.source.kivy = ../../kivy # (str) Presplash of the application #presplash.filename = %(source.dir)s/data/presplash.png # (str) Icon of the application #icon.filename = %(source.dir)s/data/icon.png # (list) Supported orientations # Valid options are: landscape, portrait, portrait-reverse or landscape-reverse orientation = portrait # (list) List of service to declare #services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY # # OSX Specific # # # 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 specific # # (bool) Indicate if the application should be fullscreen or not fullscreen = 0 # (string) Presplash background color (for android toolchain) # 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 # (string) Presplash animation using Lottie format. # see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/ # for general documentation. # Lottie files can be created using various tools, like Adobe After Effect or Synfig. #android.presplash_lottie = "path/to/lottie/file.json" # (str) Adaptive icon of the application (used if Android API level is 26+ at runtime) #icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png #icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png # (list) Permissions # (See https://python-for-android.readthedocs.io/en/latest/buildoptions/#build-options-1 for all the supported syntaxes and properties) #android.permissions = android.permission.INTERNET, (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18) # (list) features (adds uses-feature -tags to manifest) #android.features = android.hardware.usb.host # (int) Target Android API, should be as high as possible. #android.api = 31 # (int) Minimum API your APK / AAB will support. #android.minapi = 21 # (str) Android SDK version to use #android.sdk = 20 # (str) Android NDK version to use #android.ndk = 23b # (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi. #android.ndk_api = 21 # (bool) Use --private data storage (True) or --dir public storage (False) #android.private_storage = True # (str) Android NDK directory (if empty, it will be automatically downloaded.) #android.ndk_path = # (str) Android SDK directory (if empty, it will be automatically downloaded.) #android.sdk_path = # (str) ANT directory (if empty, it will be automatically downloaded.) #android.ant_path = # (bool) If True, then skip trying to update the 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 # (bool) If True, then automatically accept SDK license # 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 # (str) Android entry point, default is ok for Kivy-based app #android.entrypoint = org.kivy.android.PythonActivity # (str) Full name including package path of the Java class that implements Android Activity # use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity #android.activity_class_name = org.kivy.android.PythonActivity # (str) Extra xml to write directly inside the <manifest> element of AndroidManifest.xml # use that parameter to provide a filename from where to load your custom XML code #android.extra_manifest_xml = ./src/android/extra_manifest.xml # (str) Extra xml to write directly inside the <manifest><application> tag of AndroidManifest.xml # use that parameter to provide a filename from where to load your custom XML arguments: #android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml # (str) Full name including package path of the Java class that implements Python Service # use that parameter to set custom Java class which extends PythonService #android.service_class_name = org.kivy.android.PythonService # (str) Android app theme, default is ok for Kivy-based app # android.apptheme = "@android:style/Theme.NoTitleBar" # (list) Pattern to whitelist for the whole project #android.whitelist = # (str) Path to a custom whitelist file #android.whitelist_src = # (str) Path to a custom blacklist file #android.blacklist_src = # (list) List of Java .jar files to add to the libs so that pyjnius can access # their classes. Don&#39;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 # (list) List of Java files to add to the android project (can be java or a # directory containing the files) #android.add_src = # (list) Android AAR archives to add #android.add_aars = # (list) Put these files or directories in the apk assets directory. # Either form may be used, and assets need not be in &#39;source.include_exts&#39;. # 1) android.add_assets = source_asset_relative_path # 2) android.add_assets = source_asset_path:destination_asset_relative_path #android.add_assets = # (list) Put these files or directories in the apk res directory. # The option may be used in three ways, the value may contain one or zero &#39;:&#39; # Some examples: # 1) A file to add to resources, legal resource names contain [&#39;a-z&#39;,&#39;0-9&#39;,&#39;_&#39;] # android.add_resources = my_icons/all-inclusive.png:drawable/all_inclusive.png # 2) A directory, here &#39;legal_icons&#39; must contain resources of one kind # android.add_resources = legal_icons:drawable # 3) A directory, here &#39;legal_resources&#39; must contain one or more directories, # each of a resource kind: drawable, xml, etc... # android.add_resources = legal_resources # (list) Gradle dependencies to add #android.gradle_dependencies = # (bool) Enable AndroidX support. Enable when &#39;android.gradle_dependencies&#39; # contains an &#39;androidx&#39; package, or any package from Kotlin source. # android.enable_androidx requires android.api >= 28 #android.enable_androidx = True # (list) add java compile options # this can for example be necessary when importing certain java libraries using the &#39;android.gradle_dependencies&#39; option # see https://developer.android.com/studio/write/java8-support for further information # android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8" # (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies} # please enclose in double quotes # e.g. android.gradle_repositories = "maven { url &#39;https://kotlin.bintray.com/ktor&#39; }" #android.add_gradle_repositories = # (list) packaging options to add # 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 &#39;META-INF/common.kotlin_module&#39;", "exclude &#39;META-INF/*.kotlin_module&#39;" #android.add_packaging_options = # (list) Java classes to add as activities to the manifest. #android.add_activities = com.example.ExampleActivity # (str) OUYA Console category. Should be one of GAME or APP # If you leave this blank, OUYA support will not be enabled #android.ouya.category = GAME # (str) Filename of OUYA Console icon. It must be a 732x412 png image. #android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png # (str) XML file to include as an intent filters in <activity> tag #android.manifest.intent_filters = # (list) Copy these files to src/main/res/xml/ (used for example with intent-filters) #android.res_xml = PATH_TO_FILE, # (str) launchMode to set for the main activity #android.manifest.launch_mode = standard # (str) screenOrientation to set for the main activity. # Valid values can be found at https://developer.android.com/guide/topics/manifest/activity-element #android.manifest.orientation = fullSensor # (list) Android additional libraries to copy into 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 # (bool) Indicate whether the screen should stay on # Don&#39;t forget to add the WAKE_LOCK permission if you set this to True #android.wakelock = False # (list) Android application meta-data to set (key=value format) #android.meta_data = # (list) Android library project to add (will be added in the # project.properties automatically.) #android.library_references = # (list) Android shared libraries which will be added to AndroidManifest.xml using <uses-library> tag #android.uses_library = # (str) Android logcat filters to use #android.logcat_filters = *:S python:D # (bool) Android logcat only display log for activity&#39;s pid #android.logcat_pid_only = False # (str) Android additional adb arguments #android.adb_args = -H host.docker.internal # (bool) Copy library instead of making a libpymodules.so #android.copy_libs = 1 # (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 android.archs = arm64-v8a, armeabi-v7a # (int) overrides automatic versionCode computation (used in build.gradle) # this is not the same as app version and should only be edited if you know what you&#39;re doing # android.numeric_version = 1 # (bool) enables Android auto backup feature (Android API >=23) android.allow_backup = True # (str) XML file for custom backup rules (see official auto backup documentation) # android.backup_rules = # (str) If you need to insert variables into your AndroidManifest.xml file, # you can do so with the manifestPlaceholders property. # This property takes a map of key-value pairs. (via a string) # Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"] # android.manifest_placeholders = [:] # (bool) Skip byte compile for .py files # android.no-byte-compile-python = False # (str) The format used to package the app for release mode (aab or apk or aar). # android.release_artifact = aab # (str) The format used to package the app for debug mode (apk or aar). # android.debug_artifact = apk # # Python for android (p4a) specific # # (str) python-for-android URL to use for checkout #p4a.url = # (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy) #p4a.fork = kivy # (str) python-for-android branch to use, defaults to master #p4a.branch = master # (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch #p4a.commit = HEAD # (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) #p4a.source_dir = # (str) The directory in which python-for-android should look for your own build recipes (if any) #p4a.local_recipes = # (str) Filename to the hook for p4a #p4a.hook = # (str) Bootstrap to use for android builds # p4a.bootstrap = sdl2 # (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) #p4a.port = # Control passing the --use-setup-py vs --ignore-setup-py to p4a # "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not # Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py # NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate # setup.py if you&#39;re using Poetry, but you need to add "toml" to source.include_exts. #p4a.setup_py = false # (str) extra command line arguments to pass when invoking pythonforandroid.toolchain #p4a.extra_args = # # iOS specific # # (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.10.0 # (bool) Whether or not to sign the code ios.codesign.allowed = false # (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) The development team to use for signing the debug version #ios.codesign.development_team.debug = <hexstring> # (str) Name of the certificate to use for signing the release version #ios.codesign.release = %(ios.codesign.debug)s # (str) The development team to use for signing the release version #ios.codesign.development_team.release = <hexstring> # (str) URL pointing to .ipa file to be installed # This option should be defined along with `display_image_url` and `full_size_image_url` options. #ios.manifest.app_url = # (str) URL pointing to an icon (57x57px) to be displayed during download # This option should be defined along with `app_url` and `full_size_image_url` options. #ios.manifest.display_image_url = # (str) URL pointing to a large icon (512x512px) to be used by iTunes # This option should be defined along with `app_url` and `display_image_url` options. #ios.manifest.full_size_image_url = [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, .aab, .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&#39;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
09-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值