MonkeyBuzz -- basically, an Android remote Print!

Monkey Forums/User Modules/MonkeyBuzz -- basically, an Android remote Print!

DruggedBunny(Posted 2012) [#1]
This was created mainly since you can't easily do Print-based debugging on an Android phone.

It's a GUI-based server written in BlitzMax (source and executable provided) and a Monkey module with three main commands:

MBStart (ip_address:String)
MBPrint (message)
MBQuit

You run the server, then import monkeybuzz in your Monkey app and call MBStart during OnCreate. Then just call MBPrint to send text out to the GUI as required.

http://www.hi-toro.com/monkey/monkeybuzz/monkeybuzz.zip

More information can be found in usage.txt (READ IT IF YOU INTEND TO USE THIS!) in the above archive. (NB. Chrome complains about it because it contains an 'unknown' executable -- you'll have to click 'Keep' if that happens.)

NOT heavily tested -- basically, just the two demos supplied, but hopefully it'll work well enough to allow simple debugging from a phone! It'll also work for clients on any other platform that supports TcpStream, eg. GLFW.

(Server only tested on Windows, and the window-save functionality will only work there as it stands, but in theory should work on Linux/Mac.)


DruggedBunny(Posted 2012) [#2]
Oh, and the name is just because the original MonkeyBugger didn't sound appropriate...

Here it is running, with the clients sending messages whenever a ball hits the edge of the screen:




Xaron(Posted 2012) [#3]
That's pretty cool, thanks for that. Will try it!


skid(Posted 2012) [#4]
Nice!


This was created mainly since you can't easily do Print-based debugging on an Android phone.



You can use standard Java logging

Log.d("YourTag", "YourOutput");


which you read with the following process

C:\android-sdk\platform-tools\adb logcat

to which you may need to add some filter arguments.

[edit] hmm, trans uses adb to launch the app so I had to restart the logcat command after my app was running so this method is more relevant if Mark wanted to patch Trans to output logging to Ted


DruggedBunny(Posted 2012) [#5]

this method is more relevant if Mark wanted to patch Trans to output logging to Ted


What, and waste my over-complicated solution?! Anyway, yeah, it'd be pretty cool if Print could send over to Ted instead.


skid(Posted 2012) [#6]
I would say monkey buzz is a good start for adding all sorts of remote debugging goodies.

Dumping a reflection of all public name value pairs from the monkey app into a tree view on the server would be totally awesome for watching variables etc.

In regards to android logging, Monkey is already piping its prints to the log using this format:

				Log.i( "[Monkey]",new String( this.bos.toByteArray() ) );




AdamRedwoods(Posted 2012) [#7]
yes, if you add these commands after the adb stuff in the src/trans/targets/android.monkey and rebuild trans.exe

'' add this code after this command: If OPT_ACTION>=ACTION_RUN ,and after, Execute "adb kill-server",False
Execute "adb logcat -c",False
Execute "adb logcat [Monkey]:I *:S",False


pipes right to the console. you just have to manually stop the process.


Kauffy(Posted 2012) [#8]
My debug prints are verbose, so seeing at the time the stuff is happening is crucial for me, so this will be useful when I start having to debug on Android!

Great work.