os_android_apk_builder-py

所属分类:android开发
开发工具:Python
文件大小:25KB
下载次数:0
上传日期:2021-02-14 11:42:35
上 传 者sh-1993
说明:  该模块将从Android项目中以编程方式(动态)创建Android apk应用程序包,更快...
(This module will create an Android apk/app bundle programmatically (dynamically), from an Android project, faster and without Android Studio)

文件列表:
.DS_Store (8196, 2021-02-14)
LICENSE.txt (1065, 2021-02-14)
MANIFEST (308, 2021-02-14)
os_android_apk_builder.iml (338, 2021-02-14)
os_android_apk_builder (0, 2021-02-14)
os_android_apk_builder\.DS_Store (6148, 2021-02-14)
os_android_apk_builder\.idea (0, 2021-02-14)
os_android_apk_builder\.idea\inspectionProfiles (0, 2021-02-14)
os_android_apk_builder\.idea\inspectionProfiles\profiles_settings.xml (128, 2021-02-14)
os_android_apk_builder\.idea\misc.xml (331, 2021-02-14)
os_android_apk_builder\.idea\modules.xml (296, 2021-02-14)
os_android_apk_builder\.idea\os_android_apk_builder.iml (336, 2021-02-14)
os_android_apk_builder\.idea\vcs.xml (183, 2021-02-14)
os_android_apk_builder\__pycache__ (0, 2021-02-14)
os_android_apk_builder\__pycache__\apk_builder.cpython-36.pyc (2024, 2021-02-14)
os_android_apk_builder\__pycache__\apk_builder.cpython-39.pyc (4374, 2021-02-14)
os_android_apk_builder\apk_builder.py (6132, 2021-02-14)
os_android_apk_builder\bp (0, 2021-02-14)
os_android_apk_builder\bp\__pycache__ (0, 2021-02-14)
os_android_apk_builder\bp\__pycache__\_build_gradle_utils.cpython-39.pyc (3474, 2021-02-14)
os_android_apk_builder\bp\__pycache__\_general_utils.cpython-39.pyc (535, 2021-02-14)
os_android_apk_builder\bp\__pycache__\_res.cpython-39.pyc (1884, 2021-02-14)
os_android_apk_builder\bp\_build_gradle_utils.py (4368, 2021-02-14)
os_android_apk_builder\bp\_general_utils.py (574, 2021-02-14)
os_android_apk_builder\bp\_res.py (1770, 2021-02-14)
os_android_apk_builder\examples (0, 2021-02-14)
os_android_apk_builder\examples\properties_example.json (213, 2021-02-14)
os_android_apk_builder\objs (0, 2021-02-14)
os_android_apk_builder\objs\KeyStoreProperties.py (2017, 2021-02-14)
os_android_apk_builder\objs\__pycache__ (0, 2021-02-14)
os_android_apk_builder\objs\__pycache__\KeyStoreProperties.cpython-39.pyc (1982, 2021-02-14)
os_android_apk_builder\test.py (1622, 2021-02-14)
setup.cfg (65, 2021-02-14)
setup.py (1803, 2021-02-14)
sign_in_example.json (158, 2021-02-14)

Introduction ------------ This module will create an Android APK/App Bundle programmatically (dynamically), from an Android project, faster and without Android Studio. ## Installation Install via pip: ```python pip install os-android-apk-builder ``` ## Usage First, define your KeyStore and version properties: ```python from os_android_apk_builder.objs.KeyStoreProperties import KeyStoreProperties from os_android_app_version_changer.objs.VersionProperties import VersionProperties # set your KeyStore properties key_store_props = KeyStoreProperties(key_store_file_path='/path/to/keystore/file.jks', store_password='StorePassword123', key_alias='alias name', key_password='KeyPassword123', v1_signing_enabled=True, v2_signing_enabled=True) # set the version properties (version code and version name) version_props = VersionProperties(new_version_code=VersionProperties.RAISE_VERSION_BY_ONE, new_version_name="1.0.3") ``` NOTICE: each of the version properties can also hold, apart from specific versions, ```VersionProperties.KEEP_OLD_VERSION``` or ```VersionProperties.RAISE_VERSION_BY_ONE```. Now, generate an apk or app bundle below: # Generate APK ```python from os_android_apk_builder import apk_builder apk_builder.build_apk(project_path='/path/to/android/project', apk_dst_dir_path='/path/to/apk/output/directory', key_store_properties=key_store_props, version_properties=version_props) ``` # Generate AppBundle ```python from os_android_apk_builder import apk_builder apk_builder.build_app_bundle(project_path='/path/to/android/project', app_bundle_dst_dir_path='/path/to/app/bundle/output/directory', key_store_properties=key_store_props, version_properties=version_props) ``` ## Advanced Usage You can save your Key Store properties in a file, to avoid supplying them again with each binary build. Todo so, create a json file (or copy this [sign_in_example.json](https://github.com/osfunapps/os_android_apk_builder-py/blob/master/os_android_apk_builder/examples/properties_example.json) file): ```json { "storeFile": "path/to/keystore_file.keystore", "storePassword": "myCoolKeyStorePass", "keyAlias": "myAliasName", "keyPassword": "myAliasPassword", "v1SigningEnabled": true, "v2SigningEnabled": true } ``` Then build the KeyStoreProperties base on the link to the file: ```python key_store_props = KeyStoreProperties.build_from_file(file_path= 'path/to/json/file.xml') ``` # Alternative Gradle Path By default, the program will use your project's gradle wrapper. If, for some reason, the gradle wrapper isn't good enough, you can set a custom path to an alternative gradle. Just supply its path when creating the apk/app bundle with the argument: ```python gradle_path='path/to/gradle' ``` If you want to use your system's gradle, set: ```python gradle_path='gradle' ``` (you can write just 'gradle' if it's already recognized by your environment variables). ## Links If you all about automation, why use Android Studio?: * [os-play-console-automation](https://github.com/osfunapps/os_android_apk_builder-py/blob/master/https://github.com/osfunapps/os-android-play-console-automation-py) Will publish your apk/app bundle to the store in a jiffy * More Android and iOS automation tools can be found in [my profile](https://github.com/osfunapps/os_android_apk_builder-py/blob/master/https://github.com/osfunapps) ## Licence MIT

近期下载者

相关文件


收藏者