2015-09-07 86 views
7

我是反向工程Xcode,我想知道是否有方法來啓用調試日誌。我猜Xcode可能有一些隱藏的喜好,是嗎?Xcode內部調試日誌

回答

23

是的,您可以在Xcode中啓用大量隱藏日誌。以下是所有方面的列表,您可以在其中調整日誌級別。得到該列表

(lldb) po [[[DVTLogAspect allAspects] valueForKey:@"name"] sortedArrayUsingSelector:@selector(compare:)] 
AutomaticTermination 
AuxiliaryFilesWriting 
BlockQueue 
Build 
BuildConfigurations 
BuildContext 
BuildInfo 
BuildMessages 
BuildPlanCreation 
BuildRuleLoading 
BuildSettingExpansion 
BuildSettings 
BuildTaskCreation 
Building 
Cache 
CachePruning 
Caching 
Capabilities 
ClangCodeCompletion 
CodeSign 
CodeSignUI 
CommandInvocation 
CommandLineBuildTiming 
ConfigInspectionContext 
Container 
DBGDebugSessionPerformance 
DBGFormattedSummaryPerformance 
DBGNonPrimaryPCPerformance 
DBGStackFrameFetchPerformance 
DBGSteppingPerformance 
DBGVariablesViewPerformance 
DBGViewDebugger 
DBGXPCDebugging 
DSMDocSetLoading 
DSMDocSetSearch 
DVTActivityOptions 
DVTAnnotationManager 
DVTArchitecture 
DVTAssertionEnvironment 
DVTAssertions 
DVTBindingHelper 
DVTCodesigningAllTheThings 
DVTCollectionChecking 
DVTCommandLineTool 
DVTDevice 
DVTDeviceSearch 
DVTDownloadable 
DVTFilePath 
DVTFilePathFSEvents 
DVTFilePathLogMetrics 
DVTFileType 
DVTFindBar 
DVTFirstLaunchPackageInstallationHelper 
DVTFontAndColorTheme 
DVTInvalidExtension 
DVTMacroExpansionParsing 
DVTMacroNamepsace 
DVTMixIn 
DVTNSImageAdditions 
DVTNSImage_ImageDeallocations 
DVTNSRunLoopAdditions 
DVTPlatform 
DVTPlugInExtensionFaulting 
DVTPlugInLoading 
DVTPlugInLocator 
DVTPlugInManager 
DVTPlugInQuery 
DVTPreferenceSetManager 
DVTRegularExpression 
DVTReplacementView 
DVTSDK 
DVTSigningCertificate 
DVTSigningCertificateManager 
DVTSigningCertificateSource 
DVTSourceEditorDrawing 
DVTSourceEditorFolding 
DVTSourceEditorLayout 
DVTSourceEditorPerformance 
DVTSourceLandmarks 
DVTSourceModel 
DVTSourceScanner 
DVTSourceSpecificationLoading 
DVTStateSaving 
DVTSystemActivity 
DVTTextAnnotation 
DVTTextCompletionPerformance 
DVTTextCompletionUI 
DVTTextResponsivenessPerformance 
DVTToolchain 
DepCommandTraversal 
DepNodeTraversal 
Dependencies 
DependencyAnalysis 
DependencyGraph 
DependencyGraphCreation 
DependencyGraphCreationMetric 
DependencyGraphLock 
DependencyIssue 
DerivedInfo 
DerivedTargetAttributes 
DocumentFileTypes 
Executable 
FSWatcher 
FileInfoCaching 
FileRefCaching 
FileSuffixMapping 
FileTypeDetection 
GenericOutputParsing 
GroupEnumerator 
HdrScanning 
HeaderScanning 
Headermap 
HeadermapCreation 
Headermaps 
IBAutoAttach 
IBICPerformanceMetric 
IBMessageChannel 
IDEActivityLogSection 
IDEActivityReportFileIOCoordinator 
IDEActivityView 
IDEActivityViewIssues 
IDEActivityViewStructure 
IDEApplicationLaunchPerformance 
IDEBatchFindMetric 
IDEBatchFindNavigator 
IDEBuildAlertMonitor 
IDEBuildArbitratorDebug 
IDEBuildDebugMetric 
IDEBuildIssueProviderLogLoadingPerformance 
IDEBuildOnlyMetric 
IDEBuildOperationDebug 
IDEBuildOperationDependencies 
IDEBuildOperationMemorySnapshot 
IDEBuildOperationQueueSetResourceManagement 
IDEBuildOperationTiming 
IDEBuildTaskDebug 
IDEBuilderDebug 
IDECallHierarchy 
IDECallerGenius 
IDEClangDiagnostic 
IDECodeModule 
IDECommandManagerPerformance 
IDEContainerDebug 
IDEContainerFSEventsDebug 
IDEContainerItemSCMDebug 
IDEContextAutocreation 
IDECounterpartsGeniusResultsFinderPerformance 
IDEDeclarativeInspectorGeneratorLoadingPerformanceAspect 
IDEDiagnosticController 
IDEEditorContextDocumentForNavBarStructureChanged 
IDEEditorContextFluidSwipeDebug 
IDEEditorContextNavigation 
IDEEditorContextObjectGraphCoalescing 
IDEEditorCoordinator 
IDEEditorDocument 
IDEEditorDocumentDebug 
IDEEditorDocumentModificationAspect 
IDEEditorOpenPerformance 
IDEExecutionEnvironmentExecuteOperation 
IDEFileReferenceDebug 
IDEFileReference_CallingDocumentEditedStateChangedTooOften 
IDEFolderDebug 
IDEGeniusResults 
IDEGeniusResultsPerformance 
IDEImplicitDependenciesDebug 
IDEIndexDataSourcePerformanceAspect 
IDEIndexDatabase 
IDEIndexImporterDebug 
IDEIndexQP 
IDEIndexQuery 
IDEIndexSwiftDataSource 
IDEIndexing 
IDEIndexingASTSize 
IDEIndexingClangInvocation 
IDEIndexingMetrics 
IDEIndexingScheduling 
IDEInitialization 
IDEIssueManager 
IDEKVO 
IDEKeyBindings 
IDELicenseAgreementViewController 
IDELogStore 
IDENavigableItem 
IDENavigableItemArchivableRepresentation 
IDENavigableItemCoordinator 
IDENavigatorOutlineViewPerformance 
IDENotifications 
IDEOpenQuickly 
IDEOpenQuicklyMetrics 
IDEPackageInstallerHelper 
IDEPlaygroundExecutionCoordinator 
IDEReadOnlyItemsManager 
IDERunContextManager 
IDERunContextManagerPerformance 
IDERunDestination 
IDERunDestinationPerformance 
IDESchemeSheetOpening 
IDESourceCodeCallersCalleesGeniusResultsFinder 
IDESourceCodeIndexGeniusResultsFinder 
IDESourceCodeNavigation 
IDESourceCodeNavigationPerformance 
IDESourceCodeSymbolsColoring 
IDESourceCodeSymbolsColoringPerformance 
IDESourceControl 
IDESourceControlFileScanning 
IDESourceControlProfiling 
IDESourceControlTaskOperation 
IDESourceEditorDropRecomputableState 
IDESourceEditorTopLevelStructure 
IDESourceKitService 
IDESourceLanguageServiceSwift 
IDESourceSyntaxColoringPrefetch 
IDESyntaxColoringPerformance 
IDETestManager 
IDETestingHelperDebug 
IDETextEncoding 
IDETextIndex 
IDEUpgradeTaskPerformanceMetric 
IDEUtilityAreaPerformanceAspect 
IDEVersionedFileManager 
IDEWelcomeWindowPerformance 
IDEWorkspaceClosing 
IDEWorkspaceLoading 
IDEWorkspaceUILoading 
IndexingInfo 
InstantOff 
IntegrityChecking 
LaunchRunPhase 
MessageQueues 
Modules 
NativeBuilding 
OperationStatus 
Operations 
OptionCategories 
PersistedBuildResults 
PlatformLoading 
Plist 
PlugInCompilers 
PlugInTools 
PluginLoading 
PrecompiledHeader 
ProfileScheme 
ProjectLoading 
ProjectLocalization 
ProjectReference 
ProjectSaving 
ProjectTiming 
PropertyValue 
QuickHelp 
RecursiveSearchPaths 
RelevantToolSpecs 
RunAlerts 
SDKLoading 
SimplePreprocessor 
SourceFileFiltering 
SpecificationLoading 
SpecificationLoadingTiming 
SpecificationsDebug 
SupportedBuildTools 
TSRegularExpression 
Target 
TargetCache 
TargetCaches 
ThreadedOperations 
Unarchiving 
WorkQueueProcessing 
XBS 
XCClangResultsPostprocessor 
XCGccMakefileDependencies 
XCPropertyValue 
iPhoneSimulator 

有三個日誌級別

  1. 關鍵(默認)
  2. 標準
  3. 詳細

要更改日誌級別,追加LogLevel以方面名稱d將它寫入Xcode的首選項。例如,要獲得詳細的日誌有關SDK裝載,鍵入以下命令:

defaults write com.apple.dt.xcode DVTSDKLogLevel -int 3 && killall -u $USER cfprefsd 

要更改所有日誌級別一次,使用DVTDefaultLogLevel偏好。但是你可能不想這樣做,因爲它很快就會變得過於冗長。

如果你不想永久存儲在用戶的默認值,你可以運行從終端的Xcode並通過用戶默認的參數,而不是:

/Applications/Xcode.app/Contents/MacOS/Xcode -DVTSDKLogLevel 3 
+0

這是偉大的。您是否碰巧知道是否有簡寫讓Xcode爲所有日誌方面啓用詳細的日誌級別? – danielpunkass

+1

是的,您可以使用'DVTDefaultLogLevel',但如果您將級別設置爲3,則會生成**噸**日誌。 – 0xced

+0

這很瞭解。如果我找不出合適的具體方面,可以使用它。 – danielpunkass