Code Monkey home page Code Monkey logo

cudlr's Introduction

Deprecated

This project is no longer maintained. If you are interested in taking over the project, email [email protected].


CUDLR

CUDLR (Console for Unity Debugging and Logging Remotely) is a remote developer console for Unity. Instead of struggling to enter console commands on a mobile devices or having to constantly export debugging logs from a device, CUDLR lets you use your development machine to enter debug commands and see their output or any log messages or stack traces.

To do this, CUDLR starts a webserver on the target device to host static files and exposes a HTTP API for executing commands which can interface with your project.

We wrote CUDLR to use in Proletariat's upcoming game, World Zombination. For more info on why we wrote it and other tools we've released, check out our blog.

Features

  • Supports iOS, Android, PC/Mac Standalone, and the Unity Editor
  • Capture Unity log messages and stack traces
  • Console runs in any browser
  • Copy/paste from/to the console
  • Tab completion
  • Command history
  • Standard text-entry shortcuts (ctrl-a, ctrl-e, etc)
  • Uses standard HTML/CSS for layout

How do I use CUDLR?

  • Download the unitypackage from github or the Unity Asset Store and import it in to your project.
  • Create an empty GameObject in the scene and add the CUDLR->Server component.
  • Set the port on the component (default value is 55055).
  • Add the CUDLR.Command attribute to your code.
  • Run the game and connect to http://localhost:55055 with your browser.

An example CUDLR Server GameObject prefab is located in Assets/CUDLR/Examples. Add the GameObject to the scene, run the game, and connect to the console with your browser.

An example of adding commands is available here.

Adding Additional Commands

Add a ConsoleCommand attribute to any static method. When the Command String is entered into the console the Delegate will be called passing in any additional arguments used in the console.

[CUDLR.Command(<Command String>, <Description>, <Optional: flag to run on main thread>)]

The CUDLR.Command Callback Delegate returns void and either takes void or a string[] of arguments.

public delegate void Callback(string[] args);
public delegate void CallbackSimple();

Delegate functions can output data to the console by calling the CUDLR Console Log function or using Unity's built-in logging.

CUDLR.Console.Log( <Log String> );

Adding Additional Routes

Add a CUDLR Route attribute to any static method. When the route regex is matched, the Delegate will be called passing in the http context and optionally the regex result.

[CUDLR.Route(<Route Pattern>, <Optional: Method Pattern>)]

License

CUDLR is distributed under The MIT License (MIT), see LICENSE.

cudlr's People

Contributors

austinspafford avatar dogles avatar jkurlancheek avatar joemukai avatar lpetre avatar nadako avatar seobyeongky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cudlr's Issues

CUDLR crashing on start, some iOS devices

Check out the SocketException below. This happens to one of our (remote) testers when they boot the game either on an iPad 1 (iOS 5.0.1) or iPod 4th Gen (iOS 6.1.3). On my 4S (iOS 7.0.3) I found I got the same crash if I was on 3G instead of wifi.

(Filename: /Applications/buildAgent/work/ea95e74f6e5f192d/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 54)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1](Filename: Line: -1)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1]
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] LevelLoader:Update()
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] UnityEngine.Object:Instantiate(Object)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] UnityEngine.Object:Internal_CloneSingle(Object)
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at ServerInfo.Awake () [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] at System.Net.Dns.hostent_to_IPHostEntry (System.String h_name, System.String[] h_aliases, System.String[] h_addrlist) [0x00000] in :0
2013-11-15 23:39:10 +0000 UIKitApplication:com.spryfox.tripletown[0xdde1] SocketException: No such host is known
2013-11-15 23:39:10 +0000 tripletown SocketException: No such host is known
at System.Net.Dns.hostent_to_IPHostEntry (System.String h_name, System.String[] h_aliases, System.String[] h_addrlist) [0x00000] in :0
at System.Net.Dns.GetHostByName (System.String hostName) [0x00000] in :0
at System.Net.Dns.GetHostEntry (System.String hostNameOrAddress) [0x00000] in :0
at ServerInfo.Awake () [0x00000] in :0
UnityEngine.Object:Internal_CloneSingle(Object)
UnityEngine.Object:Instantiate(Object)
LevelLoader:Update()

Move command history off server

I think the command history buffer should be moved off the server and instead let the javascript handle the history buffer entirely.

[PR] Add in-game console

Hey there!

I don't know if this project is still maintained, but if it is, would you be interested in adding an in-game console to the CUDLR examples? I already have something ready that I could convert into a PR if you're interested. Please see the attached screenshot for further details (I'll alter the implementation to use Unity's default font if you're willing to integrate the change).

Image

Cheers
Philipp

Namespaces, ffs

I love how much you guys are giving back to the unity community, it's so great. I'm excited about getting CUDLR running, but as soon as I imported it, your Console class clashed with System.Console, which is imported in almost every file by default through using System, and used in some of my code. I can't resolve any conflicts with a using Console = System.Console because your code is in the global namespace!

Would love it if you made sure all your classes were namespaced in future releases.

Increase buffer size for log

I'm not sure if there is a way to increase the number of logs? It scrolls back to only about 50 lines right now

Cannot connect to CUDLR running on Galaxy SII, running Android 4.1.2

Have connected to same code running on an iOS device and from in the editor on OSX, under the same wifi router.

Found the IP address from the Galaxy's wifi settings. Connecting from a browser gave me a white screen after a period of time - no DNS errors, no CUDLR errors.

Logcat showed the server starting, spitting out "Starting CUDLR Server on port..." and no following errors.

The device is connected to the internet (I can use the web browser), using the same wifi router as the laptop browser that's attempting to connect to it.

handling very long parameters

I'm still using this in all our spryfox projects. QA love it!

I tried making a command that took a dump of our save file and sent it to the game. However this save file is longish (about 1.7k), and between the html console and reaching my CUDLR.Command(), the string gets truncated. I've tried digging around both in the javascript and the C# server, looking for some constant that truncated input, but to no avail.

Any ideas what could be causing this, and if so, any ideas on a workaround?

colors in console

it would be nice to have colored console output, for example for logging exceptions.

Application.RegisterLogCallback deprecated

Unity 5 uses an event instead so in OnEnable() in Server.cs

Application.RegisterLogCallback(Console.LogCallback);

should become

Application.logMessageReceived += Console.LogCallback;

and OnDisable() replace

Application.RegisterLogCallback(null);

with

Application.logMessageReceived -= Console.LogCallback;

Can fork and do a PR if that helps

Client commands

Right now the server has all of the commands. It would be nice if the client (javascript) could also have its own commands - then the client and server commands are combined into the command listing when help is invoked.

As an example, as part of Issue #9 I removed the 'Clear' command from the server because it no longer made sense there. However, since the client doesn't have any concept of commands itself, I couldn't add a typed clear command and instead had to result to a button.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.