Skip to content

Commit 59d3cfb

Browse files
authored
Feature/mac support (#225)
1 parent a33f5d0 commit 59d3cfb

18 files changed

+542
-13
lines changed

Editor/BacktraceClientConfigurationEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override void OnInspectorGUI()
2626
#else
2727
settings.IgnoreSslValidation = false;
2828
#endif
29-
#if UNITY_ANDROID || UNITY_IOS
29+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
3030
settings.HandleANR = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_ANR, settings.HandleANR);
3131
settings.OomReports = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_OOM, settings.OomReports);
3232
#endif

Editor/BacktraceConfigurationEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public override void OnInspectorGUI()
137137
#endif
138138

139139

140-
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES
140+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_STANDALONE_OSX
141141
SerializedProperty captureNativeCrashes = serializedObject.FindProperty("CaptureNativeCrashes");
142142
EditorGUILayout.PropertyField(
143143
captureNativeCrashes,
@@ -153,7 +153,7 @@ public override void OnInspectorGUI()
153153
serializedObject.FindProperty("HandleANR"),
154154
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));
155155
#endif
156-
#if UNITY_ANDROID || UNITY_IOS
156+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
157157
EditorGUILayout.PropertyField(
158158
serializedObject.FindProperty("OomReports"),
159159
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_OOM));

Mac.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mac/Backtrace-Unity-Mac-bundle.bundle.meta

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>23F79</string>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en</string>
9+
<key>CFBundleExecutable</key>
10+
<string>Backtrace-Unity-Mac-bundle</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>Backtrace.Backtrace-Unity-Mac-bundle</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>Backtrace-Unity-Mac-bundle</string>
17+
<key>CFBundlePackageType</key>
18+
<string>BNDL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSupportedPlatforms</key>
22+
<array>
23+
<string>MacOSX</string>
24+
</array>
25+
<key>CFBundleVersion</key>
26+
<string>1</string>
27+
<key>DTCompiler</key>
28+
<string>com.apple.compilers.llvm.clang.1_0</string>
29+
<key>DTPlatformBuild</key>
30+
<string></string>
31+
<key>DTPlatformName</key>
32+
<string>macosx</string>
33+
<key>DTPlatformVersion</key>
34+
<string>14.5</string>
35+
<key>DTSDKBuild</key>
36+
<string>23F73</string>
37+
<key>DTSDKName</key>
38+
<string>macosx14.5</string>
39+
<key>DTXcode</key>
40+
<string>1540</string>
41+
<key>DTXcodeBuild</key>
42+
<string>15F31d</string>
43+
<key>LSMinimumSystemVersion</key>
44+
<string>10.13</string>
45+
<key>NSHumanReadableCopyright</key>
46+
<string>Copyright © 2024 Backtrace. All rights reserved.</string>
47+
</dict>
48+
</plist>
Binary file not shown.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>files</key>
6+
<dict/>
7+
<key>files2</key>
8+
<dict/>
9+
<key>rules</key>
10+
<dict>
11+
<key>^Resources/</key>
12+
<true/>
13+
<key>^Resources/.*\.lproj/</key>
14+
<dict>
15+
<key>optional</key>
16+
<true/>
17+
<key>weight</key>
18+
<real>1000</real>
19+
</dict>
20+
<key>^Resources/.*\.lproj/locversion.plist$</key>
21+
<dict>
22+
<key>omit</key>
23+
<true/>
24+
<key>weight</key>
25+
<real>1100</real>
26+
</dict>
27+
<key>^Resources/Base\.lproj/</key>
28+
<dict>
29+
<key>weight</key>
30+
<real>1010</real>
31+
</dict>
32+
<key>^version.plist$</key>
33+
<true/>
34+
</dict>
35+
<key>rules2</key>
36+
<dict>
37+
<key>.*\.dSYM($|/)</key>
38+
<dict>
39+
<key>weight</key>
40+
<real>11</real>
41+
</dict>
42+
<key>^(.*/)?\.DS_Store$</key>
43+
<dict>
44+
<key>omit</key>
45+
<true/>
46+
<key>weight</key>
47+
<real>2000</real>
48+
</dict>
49+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
50+
<dict>
51+
<key>nested</key>
52+
<true/>
53+
<key>weight</key>
54+
<real>10</real>
55+
</dict>
56+
<key>^.*</key>
57+
<true/>
58+
<key>^Info\.plist$</key>
59+
<dict>
60+
<key>omit</key>
61+
<true/>
62+
<key>weight</key>
63+
<real>20</real>
64+
</dict>
65+
<key>^PkgInfo$</key>
66+
<dict>
67+
<key>omit</key>
68+
<true/>
69+
<key>weight</key>
70+
<real>20</real>
71+
</dict>
72+
<key>^Resources/</key>
73+
<dict>
74+
<key>weight</key>
75+
<real>20</real>
76+
</dict>
77+
<key>^Resources/.*\.lproj/</key>
78+
<dict>
79+
<key>optional</key>
80+
<true/>
81+
<key>weight</key>
82+
<real>1000</real>
83+
</dict>
84+
<key>^Resources/.*\.lproj/locversion.plist$</key>
85+
<dict>
86+
<key>omit</key>
87+
<true/>
88+
<key>weight</key>
89+
<real>1100</real>
90+
</dict>
91+
<key>^Resources/Base\.lproj/</key>
92+
<dict>
93+
<key>weight</key>
94+
<real>1010</real>
95+
</dict>
96+
<key>^[^/]+$</key>
97+
<dict>
98+
<key>nested</key>
99+
<true/>
100+
<key>weight</key>
101+
<real>10</real>
102+
</dict>
103+
<key>^embedded\.provisionprofile$</key>
104+
<dict>
105+
<key>weight</key>
106+
<real>20</real>
107+
</dict>
108+
<key>^version\.plist$</key>
109+
<dict>
110+
<key>weight</key>
111+
<real>20</real>
112+
</dict>
113+
</dict>
114+
</dict>
115+
</plist>

Runtime/BacktraceClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ private void OnDestroy()
712712
_instance = null;
713713
Application.logMessageReceived -= HandleUnityMessage;
714714
Application.logMessageReceivedThreaded -= HandleUnityBackgroundException;
715-
#if UNITY_ANDROID || UNITY_IOS
715+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
716716
Application.lowMemory -= HandleLowMemory;
717717
#endif
718718
if (_nativeClient != null)
@@ -1040,7 +1040,7 @@ private void CaptureUnityMessages()
10401040
{
10411041
Application.logMessageReceived += HandleUnityMessage;
10421042
Application.logMessageReceivedThreaded += HandleUnityBackgroundException;
1043-
#if UNITY_ANDROID || UNITY_IOS
1043+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
10441044
Application.lowMemory += HandleLowMemory;
10451045
#endif
10461046
}
@@ -1069,7 +1069,7 @@ internal void HandleUnityBackgroundException(string message, string stackTrace,
10691069
HandleUnityMessage(message, stackTrace, type);
10701070
}
10711071

1072-
#if UNITY_ANDROID || UNITY_IOS
1072+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
10731073
internal void HandleLowMemory()
10741074
{
10751075
if (!Enabled)

Runtime/Model/Attributes/MachineAttributeProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ private void IncludeOsInformation(IDictionary<string, string> attributes)
8989
#if UNITY_IOS && !UNITY_EDITOR
9090
attributes["uname.version"] = UnityEngine.iOS.Device.systemVersion;
9191
attributes["uname.fullname"] = Environment.OSVersion.Version.ToString();
92+
#elif UNITY_STANDALONE_OSX && !UNITY_EDITOR
93+
attributes["uname.fullname"] = Environment.OSVersion.Version.ToString();
9294
#endif
9395
}
9496

Runtime/Model/BacktraceConfiguration.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public class BacktraceConfiguration : ScriptableObject
146146
/// <summary>
147147
/// Handle ANR events - Application not responding
148148
/// </summary>
149-
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
149+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
150150
[Tooltip("Capture ANR events - Application not responding")]
151151
#else
152152
[Obsolete("Not supported")]
@@ -157,7 +157,7 @@ public class BacktraceConfiguration : ScriptableObject
157157
/// <summary>
158158
/// Anr watchdog timeout in ms. Time needed to detect an ANR event
159159
/// </summary>
160-
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
160+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
161161
[Tooltip("ANR watchdog timeout")]
162162
#else
163163
[Obsolete("Not supported")]
@@ -167,7 +167,7 @@ public class BacktraceConfiguration : ScriptableObject
167167
/// <summary>
168168
/// Send Out of memory exceptions to Backtrace.
169169
/// </summary>
170-
#if UNITY_ANDROID || UNITY_IOS
170+
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
171171
[Tooltip("Send Out of Memory exceptions to Backtrace")]
172172
#else
173173
[Obsolete("Not supported")]
@@ -177,7 +177,7 @@ public class BacktraceConfiguration : ScriptableObject
177177
/// <summary>
178178
/// Enable client side unwinding.
179179
/// </summary>
180-
#if UNITY_2019_2_OR_NEWER && (UNITY_ANDROID || UNITY_IOS)
180+
#if UNITY_2019_2_OR_NEWER && (UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX)
181181
[Tooltip("Enable client-side unwinding.")]
182182
#else
183183
[Obsolete("Not supported")]

0 commit comments

Comments
 (0)