I have an application that is uploaded to AppStore. And I have a device (iPhone, jailbroken) with this app installed. Is there any way to see what “Debug.Log” is outputting in the build?
I’ve found only way to see the console through “iPhone Configuration Utility”, but there are only some system outputs in that console.
Is there any chance to see something similar to what I see when I build a project directly to my phone and then look at xCode’s “all output” ?
I had the same problem, but preferred instead to use a bridge to pipe Debug.Log messages to NSLog. The downside of this approach is that, in XCode’s console, you see the messages twice. The advantage is that, when running a TestFlight’d build, I see the messages live as they happen in XCode’s Window / Devices log when the app is running on my selected device.
STEP 1 – register a callback so that Debug.Log’s are piped to method in my iOS plugin
STEP 2 – implement method in my iOSPlugin to pipe these calls to the native app
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class IOSPlugin : MonoBehaviour {
#if UNITY_IPHONE
[DllImport ("__Internal")]
private static extern void _logToiOS(string debugMessage);
#endif
public static void LogToiOS(string logString, string stackTrace, LogType type) {
// We check for UNITY_IPHONE again so we don't try this if it isn't iOS platform.
#if UNITY_IPHONE
// Now we check that it's actually an iOS device/simulator, not the Unity Player. You only get plugins on the actual device or iOS Simulator.
if (Application.platform == RuntimePlatform.IPhonePlayer) {
_logToiOS(logString + "
===============
" + stackTrace);
} #endif
}
}
STEP 3 – implement a method in my iOS app’s AppController.mm to pipe this to NSLog – you should be able to just directly drop this in your AppController.mm and be all set
First build your iOS app with “Development Build” enabled. In Unity 4, Debug.Log() output is shown in the XCode’s debug Console. Notice that this is NOT the Console in the Organizer, which shows the device events, but it’s the Console that is shown at the bottom of the main window, which is called Debug area. The Organizer’s Device Logs is useful to obtain the crash logs when the app is executing out of XCode.
You can check that with another option. Connect you phone to your MAC which have xCode install. Now open xCode and from xCode open Organizer. From Organizer select Devicestab and in that you can see you device in that. And from your selected device select Console in that you can see the device log.
Then you can take your file using Window → Devices & Simulators → select your device → select your app → press settings button below → select “download container” from dropdown. xcappdata file will be saved. Reveil in finder, click right mouse button, click “show package contents”, then go to Documents folder. There will be your file.