Add Debug > Force Crash command. Also: let the test for crash report sending work in production.

This commit is contained in:
Brent Simmons 2021-03-06 14:44:58 -08:00
parent 0fa4c02d63
commit 91a825343a
2 changed files with 16 additions and 6 deletions

View File

@ -715,9 +715,11 @@ extension AppDelegate {
} }
@IBAction func debugTestCrashReportSending(_ sender: Any?) { @IBAction func debugTestCrashReportSending(_ sender: Any?) {
#if DEBUG CrashReporter.sendCrashLogText("This is a test. Hi, Brent.")
CrashReporter.sendCrashLogText("This is a test. Hi, Brent.") }
#endif
@IBAction func forceCrash(_ sender: Any?) {
fatalError("This is a deliberate crash.")
} }
@IBAction func openApplicationSupportFolder(_ sender: Any?) { @IBAction func openApplicationSupportFolder(_ sender: Any?) {

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17147" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies> <dependencies>
<deployment identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17147"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Application--> <!--Application-->
@ -516,6 +516,7 @@
<action selector="debugDropConditionalGetInfo:" target="Voe-Tx-rLC" id="X24-9X-rwG"/> <action selector="debugDropConditionalGetInfo:" target="Voe-Tx-rLC" id="X24-9X-rwG"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="Dij-Nu-eot"/>
<menuItem title="Test Crash Reporter Window" id="gVd-kQ-efj"> <menuItem title="Test Crash Reporter Window" id="gVd-kQ-efj">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -528,6 +529,13 @@
<action selector="debugTestCrashReportSending:" target="Ady-hI-5gd" id="olQ-kb-kkm"/> <action selector="debugTestCrashReportSending:" target="Ady-hI-5gd" id="olQ-kb-kkm"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem title="Force Crash" id="gVt-cz-eoJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="forceCrash:" target="Ady-hI-5gd" id="a2x-LM-60G"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Nzi-Mb-uxc"/>
<menuItem title="Debug Search" id="9Ot-wC-s5U"> <menuItem title="Debug Search" id="9Ot-wC-s5U">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -682,7 +690,7 @@
</items> </items>
</menu> </menu>
</objects> </objects>
<point key="canvasLocation" x="-54" y="-144"/> <point key="canvasLocation" x="-277" y="-69"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>