gomobile and debug flow

628 views
Skip to first unread message

Joe Blue

unread,
Nov 23, 2015, 9:50:08 AM11/23/15
to golang-nuts
I am wondering if anyone can suggest a good approach to develop golang mobile apps.

For non GUI code, its possible to just run it on your laptop, but anything that needs to talk GL, wil not be able to run on your laptop.

things i have tried:
- Compile 6 deploying the compiled APK to the phone and check logs.
- Run in emulator and watch logs. Arm emulator is way too slow for this.






Daniel Skinner

unread,
Nov 23, 2015, 9:54:41 AM11/23/15
to Joe Blue, golang-nuts

> but anything that needs to talk GL, wil not be able to run on your laptop.

Is that bc you're developing on windows?


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Blue

unread,
Nov 23, 2015, 10:20:37 AM11/23/15
to golang-nuts, joeb...@gmail.com
@Daniel,

I am on OSX and golang 1.5.1

i am just looking for ways to play around.
At the moment i use delve with visual studio code. In the last few days the two have been integrated.
Thats super awesome for standard go code. In fact i am amazed how good the combo is. It great to be able to step all the way down to the runtime and back out, and learn more too.

But i am looking for best practices to developing apps that depend on mobile.

thanks in advance

Daniel Skinner

unread,
Nov 23, 2015, 10:43:47 AM11/23/15
to Joe Blue, golang-nuts
You should be able to simply `go run *.go` and test GL code and basic input. Are you seeing an error otherwise? As for a workflow, here's a script i use to build, install, run, and check filtered logs (no back logs by default). https://gist.github.com/dskinner/ae723c97ea8ac60ddb58
use like `godroid build install run logcat` or any combination of commands. At the very least, the filtered logs are most helpful.

sri...@laddoo.net

unread,
Nov 23, 2015, 1:07:07 PM11/23/15
to golang-nuts
All of the gomobile code I've written has been as non-UI logic for SDK apps, so I'm not sure if my experience directly transfers to GL-based apps. That being said, here's what I've been doing:

Android: I use a Nexus 4 since the ARM emulator is downright unusable. On OSX it crashes randomly and at other times it's extremely slow (on a 2013 Macbook Pro).
iOS: The iOS simulator has been a pleasure to work with. It is lightweight and fast and I've rarely had to load my code on an iPhone, except for when I'm using APIs not available on the simulator.

Hope this helps!
Sridhar

Joe Blue

unread,
Nov 24, 2015, 5:48:34 AM11/24/15
to golang-nuts
Thanks all for the tips.

Daniel, that is a similar process to what i am doing now.
Sridhar, yes i am develop non gui android stuff, and use the sim.
Android studio 2, looks like it will be less painful, but in no rush there.

i have managed to run basic opengl examples, using the delve debugger. I makes it easier to quickly inspect local variable etc.
But its non deterministic, in that it sometimes does not start the process.
I am still playing around gomobile to see why.
Reply all
Reply to author
Forward
0 new messages