[SOLVED]Android check standard output?

Discuss any ports of LÖVE to different platforms.
Post Reply
sunsflower
Prole
Posts: 18
Joined: Mon Jan 04, 2016 10:36 am

[SOLVED]Android check standard output?

Post by sunsflower » Sat Sep 03, 2016 2:14 pm

When I run love on android, how can I see the content I "print" to standard output, since when I run the app no console is shown? Do I need root first?
thanks!
Last edited by sunsflower on Mon Sep 05, 2016 12:10 am, edited 1 time in total.

User avatar
raidho36
Party member
Posts: 1516
Joined: Mon Jun 17, 2013 12:00 pm

Re: Android check standard output?

Post by raidho36 » Sat Sep 03, 2016 3:27 pm

I don't think you can print to a "phone console" since it isn't there; normally debug output goes to PC IDE console via debug mode USB connection but you'd had to launch the app via debug mode USB connection as well.

You can always just rewrite "print" to output directly to the game screen, as an overlay.

User avatar
Positive07
Party member
Posts: 999
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Android check standard output?

Post by Positive07 » Sat Sep 03, 2016 5:07 pm

Here there are two links on how to get print output from LÖVE through Logcat
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

sunsflower
Prole
Posts: 18
Joined: Mon Jan 04, 2016 10:36 am

Re: Android check standard output?

Post by sunsflower » Sun Sep 04, 2016 1:33 am

thanks a lot! no phone console indeed.
by and by i've installed a terminal simulator. is it possible to run love with a folder which contains main.lua on android(actually Im trying to develop on my phone...) just like on a pc console(in the simulator...)?

User avatar
HugoBDesigner
Party member
Posts: 402
Joined: Mon Feb 24, 2014 6:54 pm
Location: Somewhere in Brazil

Re: Android check standard output?

Post by HugoBDesigner » Sun Sep 04, 2016 1:45 am

It is possible to code directly from an Android phone. I used to code from my Android tablet all the time. All you need is to install the LÖVE for Android app and a code editor. Then you'll write your game in your "lovegame" folder (in the root folder, I think. Don't take my word for it). As far as I know, though, you have to open the LÖVE app every time you want to test, but it still works pretty well ;)
HugoBDesigner - my Twitter
HugoBDesigner - my Blog

sunsflower
Prole
Posts: 18
Joined: Mon Jan 04, 2016 10:36 am

Re: Android check standard output?

Post by sunsflower » Sun Sep 04, 2016 2:27 am

so I need to root my phone first(havn't done it yet @=_=@ )? currently I always have to compress a .zip and rename it to a .love file and then use a file manangement app to open it....

p.s.: ah, never mind. I've found a description in goolge playstore:
You can run games in multiple ways:

Upload your .love file to a web server and open the link with a browser on your Android device
- or -
Put the .love file on your device and open it with a file explorer (e.g. X-plore, open file as */*, select LÖVE for Android).
- or -
Extract it to /sdcard/lovegame such that main.lua is found at /sdcard/lovegame/main.lua and then run the app
- or -
Extract your game anywhere on your device and open its main.lua using a file browser (e.g. X-plore, open main.lua as */*, select LÖVE for Android).

With extracted sources you can edit the source files with any text editor of your choice to tweak your game or add new functionality.

User avatar
HugoBDesigner
Party member
Posts: 402
Joined: Mon Feb 24, 2014 6:54 pm
Location: Somewhere in Brazil

Re: Android check standard output?

Post by HugoBDesigner » Sun Sep 04, 2016 3:16 pm

Yeah, I meant in the root folder as in /sdcard/, not exactly "rooting your phone" (bad wording from my part, sorry). But at least you found a more detailed explanation than I could give, so it's nice that you found it :awesome:

P.S.: I think it is recommended that you add [SOLVED] to your thread's title after you found the solution :)
HugoBDesigner - my Twitter
HugoBDesigner - my Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest