使用adb logcat获取应用程序的输出,或者使用在线提供的帮助显示日志和grep for'Python'的应用程序之一。在
以上详细步骤:
在设备上启用开发者选项(谷歌是你的朋友)。
然后启用usb调试。在
然后使用usb电缆将设备连接到pc,然后在控制台中键入adb devices。
它应该显示您的设备(可能会出现提示,要求您获得连接到计算机的权限)。在
一种更简单的方法是在小部件上使用视觉指示,而不是在控制台上打印。
你可以为你的应用程序创建一个函数bubprintfrom kivy.core.window import Window
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.lang import Builder
Builder.load_string('''
# declare our message StringProperty
message: 'empty message'
# let the bubble be of 200 device pixels
# and expand as necessary on the height
# depending on the message + 20 dp of padding.
size_hint: None, None
show_arrow: False
pos_hint: {'top': 1, 'right': 1}
size: dp(200), lbl.texture_size[1] + dp(20)
Label:
id: lbl
text: root.message
# constraint the text to be displayed within
# the bubble width and have it be unrestricted
# on the height.
text_size: root.width - dp(20), None
''')
def bubbprint(self, message):
message = repr(message)
if not self.info_bubble:
self.info_bubble = Factory.InfoBubble()
self.info_bubble.message = message
# Check if bubble is not already on screen
if not self.info_bubble.parent:
Window.add_widget(self.info_bubble)
# Remove bubble after 2 secs
Clock.schedule_once(lambda dt:
Window.remove_widget(self.info_bubble), 2)