Logs Generated when launching an App in Kivy Launcher on Android - python

I know we can launch an app in Android using Kivy launcher for android https://play.google.com/store/apps/details?id=org.kivy.pygame
and i can launch apps by the same as well . But i need to know how and where can we see the logs generated by the app in it ? For example if i run kivy app on my desktop i will be able to see logs on console but where will i find them when launching an app by kivy launcher ?
If we cant see logs is there any ways to make this possible ?

On android, kivy prints all python's normal terminal output to the android logcat stream. You can view this from the desktop by connecting your phone via usb and doing adb logcat. adb is provided by the android sdk, so if it's not in your path you can probably find it there. If you use buildozer, I think you can access its auto-downloaded android sdk using
buildozer android logcat
You can also view the adb output using some apps on the play store (may only work with older android versions though, I think something changed here).
Kivy may also store logs as text files somewhere on the sd card, possibly in the app directory (i.e. somewhere in the kivy launcher's kivy directory), but I haven't ever really used this, adb is a lot more convenient.

When your application is executed a .kivy folder will be created (if not already there).
In it you'll see a logs folder. The logs there are the same obtained via "adb logcat".

Related

Is it possible to run code without gui on android?

I got python code that has no GUI and works in terminal. Can I convert it to apk and run on android?
I'm just curious if it's possible.
No, you cannot directly run a Python script in the terminal as an Android app. Python scripts are typically run on a computer using the Python interpreter, and Android devices use the Android operating system which is different from the typical computer operating systems.
However, you can use a tool such as Kivy, which is a Python library for creating mobile apps, to create an Android app from your Python script. Kivy provides a way to package your Python code into an Android app, so you can run it on an Android device.
I am sure there are other tools providing this option as well. These tools essentially bundle the Python interpreter and your script into a single executable file, so the user doesn't need to have Python installed on their device to run your app.
I believe there are tutorials on youtube as well so as to how to use Kivy to run your python code. I hope this helps :)

pydroid3 python program converted to android app with buildozer will not start on android How can I debug?

I created a kivy app in python using pydroid3 It is quite simple, a single button. It works on the android device when run from pydroid3.
I successfully converted the python app to an android app using bulldozer.
Primary Question
I cannot get any debug feedback from the android device as to why the application crashes at start-up.
Can someone help find the location of some sort of android logs similar to syslog or PHP log in Ubuntu.
Here is what I have done to solve this problem myself:
I found documentation on how to properly configure the conversion with buildozer.spec. Soon I realized that I was adding all the python modules involved in the program - but most documentation says that buildozer scans the original files and imports the necessary modules, but still after numerous failures, I added as many as I determined needed to be included.
Each time I start the app on the android 10 device (a radio head), it just crashes upon opening. No error messages etc. I find it unexpected that there is no way to view some kind of Syslog in android. But still, I continued.
I installed android desktop (AD) on my Mac laptop and then connected it to the android head unit and setup the unit to allow USB debugging. I was able to get AD to spew out endless lines of real-time data in the Logcat display.
I was not able to identify anything related to my app in the output provided by logcat: a search using the filter resulted in nothing associated with my app's name. Further, nothing shows up searching for "error" "failure, "failure to load," etc -- that might have given me a clue.
Next Question
Are there any documents related to how to create a program in python, using buildozer, and then install and debug the app in android?
I am sure this is one simple missing module or a similar issue that should be glaring in an error log somewhere.
Thanks for any help.
Jack
.
see the information above

How to run Python code made for Android device on Windows 10?

I am making an Android app with Python (kivy), and I am using plyer's stt, which only supports Android. I used Pydroid3 to check my code, and it works, but I don't want to send the code from my pc to my phone every time I want to check if it works. Is there any way to run a .py file that only works on Android, on a Windows device? Like a virtual phone or something?
I found out that Android Studio has a built in Android Device Emulator, wich is basically a virtual Android device. Inside that you can download Pydroid 3 and run your Python code there. If your application requires addiditional permissions, you can use Pydroid Additional Permissions Plugin.

How can we use Bluestacks android emulator for testing Kivy app buildozer?

I want to use Bluestacks for testing and debugging my Kivy app with Buildozer. So, please guide me how to use Bluestacks for debugging Kivy app
I'm using Google Colab for debugging If other methods are possible, please let me know
NOTE: - This method doesn't use Colab but it does allow you to use the same functionality of adb to view the log for debugging purposes
Bluestacks comes pre-installed with a debugging tool which is located in C:\Program Files (x86)\BlueStacks
I'm pretty sure that you can view the log of Bluestacks and the apps it is running using said file with the following commands.
cd "C:\Program Files (x86)\BlueStacks"
HD-Adb.exe logcat

App doesn't work after using Kivy/Buildozer

I use buildozer android debug deploy run to install my app on my android and my app installs but I can't run it on my phone
Here is my .spec file I got spam error so I send link to google drive
https://docs.google.com/document/d/1Rn1xDuWcGSvZsDVLVKeGUdwOtRtE1nNzJd91EHYmXwM/edit?usp=drivesdk
I am new to kivy and buildozer so can you tell me what I am doing wrong or what else should I attach to this post.And also I use some python build in modules in my project. Do I have to add them in requirements?

Categories