No project description provided
Project description
Kivy Reloader
Hot reload your Kivy app on multiple phones and computer in real-time.
This tool allows you to instantly update your Kivy app on multiple devices simultaneously by pressing Ctrl+S
, saving your precious development time and effort.
How to use
from kivy_reloader import App
class MainApp(App):
def build_and_reload(self):
from screens.main_screen import MainScreen
return MainScreen(name="Main Screen")
MainApp()
https://github.com/kivy-school/kivy-reloader/assets/23220309/f1459d7e-ca53-4ed6-b4d1-980cdae4ce16
Prerequisites
Install scrcpy
on your operating system: Linux, Windows or macOS. You will be able to control your device from your computer.
Install kivy
: choose your operating system on Kivy School Tutorial.
How to install:
I recommend you to use poetry
to install kivy-reloader
.
Option 1) Using poetry - recommended
poetry add kivy-reloader
Option 2) Using pip
pip install kivy-reloader
Configure the constants
The first time you run from kivy_reloader import App
, you will be prompted on the terminal:
Just press enter. This will create a file called settings.py
on your project folder.
Every line has an explanation above. The most important constants on this file are:
- PHONE_IPS: Put the IP of your phone here. You can find the IP of your Android phone on: Settings > About phone > Status > IP Address.
- HOT_RELOAD_ON_PHONE: Set it to True to hot heload on your phone when you press
Ctrl+S
- WATCHED_FOLDERS_RECURSIVELY: This is a list of folder names, for example
["screens", "components"]
. If any file inside these folders change, your Kivy app will reload. - WATCHED_KV_FOLDERS_RECURSIVELY: This is a list of folder names, for example
["screens", "components"]
. This is where the Reloader will find your.kv
files to reload them every time you pressCtrl+S
.
Open the file settings.py
and explore the other constants.
This message will also appear for you on the first time you use Kivy Reloader.
Just press enter. This will create a file called buildozer.spec
on your project folder.
How to use:
- Connect your phone to the computer using a USB cable.
- Create a script
compile.py
with the following code:
from kivy_reloader import compile_app
compile_app.start()
- Run on the terminal
python compile.py
, type1
and press enter. Buildozer will compile the app and deploy on your phone. - Once the app is on your phone, run
python main.py
and the hot reload will be already working. Just pressCtrl+S
in any file insidescreens
folder ormain.py
and your app will be updated on computer and phone at the same time.
Do you want to test directly from this repo?
Clone this project, open the folder on terminal and type:
poetry shell
poetry install
python main.py
python compile.py
and press 1, enter.- Wait the compilation to finish on your phone.
- Enjoy the Kivy Reloader!
I am too impatient, I want to see it working RIGHT NOW!
Clone this project, open the folder on terminal and type:
poetry shell
poetry install
adb install bin/kivy_super_reloader-0.1-armeabi-v7a_arm64-v8a-debug.apk
python main.py
- Keep calm and enjoy the Kivy Reloader! 😄
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kivy_reloader-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04172c4b2db619617f944b9d6606f1c3351ee30de86249c121eeaaf2a62d3536 |
|
MD5 | c93d3e506697f507bf777a39f079772e |
|
BLAKE2b-256 | 67dc3dba596b376ecb1a2ea209b6d4dfc8abfd0d2e6f7af0477862e7fc6a73a7 |