I'm having a pretty strange issue I haven't encountered before in Unity - I'm unable to get my Debug.Log()
calls, or my NSLog()
calls from Unity and Xcode to display to the console when I build the application to my device.
Here's what I've been trying so far:
.ipa
file manually, neither have worked.The only output I get from my application is this line in the main.mm file generated by Unity in the Xcode project:
NSLog(@"-> registered mono modules %p\n", &constsection);
I don't see the other default logs and prints that are in the project by default either, such as the following line in UnityAppController.mm
:
printf_console("-> applicationDidFinishLaunching()\n");
The odd thing is, I saw all of these logs and my own at one point very early on the in the project, but now I no longer do. I've tried stepping back and reverting to an earlier build, but I'm still not seeing any logs. I've also tried building to a new Xcode project and building that to my device, but with no luck either.
What are some things I could be missing? I've looked over as many other topics as I could and tried several suggestions, but haven't been able to find anything so far. Is there any reason I would receive the first debug log from Unity about registering mono modules but none of the others? I can't find a good reason, and its making my debugging on the device a living pain without them.
For reference, I'm using Unity 4.5.1 and Xcode 5.1.1.
Have you tried attaching to the Unity
log message event?
public Text logText; //someRandomUnityUITextThatIsShownOnScreen
void Start(){
Application.logMessageReceived += HandleLog; //can disable logging with Application.logMessageReceived -= HandleLog;
}
void HandleLog(string logString, string stackTrace, LogType type)
{
logText.text += "\n | " + logString;
//of course you can use the logstring and stacktrace to do whatever you want, write into a debug txt file or smth.
}
if that doesn't work either, it is probably an iOS
bug right now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With