Where is the log printed when I use print(“”) in Corona Engine?

馋奶兔 提交于 2020-01-13 04:20:08

问题


I used the print("Helloworld") function in the code, where is the output printed?


回答1:


A lot depends on how you started Corona and if you're on a Mac or PC or if you're looking for this information while running in the XCode simulator or on a device.

For a Mac, you are best to start Corona SDK using the "corona-terminal" app in the Applications/CoronaSDK folder. This will launch the Terminal app, which will in turn launch Corona SDK. Your errors, warnings and print statements will show in the terminal window that gets started up. There are some IDE type editors that can start Corona SDK for you in which case, they can capture the output and show it in the IDE.

On a PC, Corona SDK will start up a cmd shell screen for you. The print messages show there.

When using the XCode simulator (not the Corona SDK simulator), you will find the output in the Console app. Using spotlight (The magnifying glass at the top right of your mac), type in "Console" and launch the application.

If you have installed the app to an Apple device, you can use XCode's Organizer with your device tethered to the Mac's USB port and there is a link on the left nav bar called "Console" that will let you see the log messages from the device.

On Android, you need to install the "Android Debug Bridge" tools and from a terminal window, you can enter the command:

 adb logcat

with your Android device tethered to your computer's USB port to see the console log messages from the Android device. The Android device needs to be in "Developer Mode" for this to work.




回答2:


If you are using Mac, follow this steps:

  1. Open Finder
  2. Go to Applications>Corona SDK>Corona Terminal
  3. Once it launches, click the "Simulator" button
  4. Navigate to your project folder and select the "main.lua" (your project starting file)
  5. It will then open your program in the simulator at the same time prints the logs in the terminal.

If you are using PC, simply double click Corona and the terminal will be opened automatically.



来源:https://stackoverflow.com/questions/16730247/where-is-the-log-printed-when-i-use-print-in-corona-engine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!