求助:Xcode 9.3中Coverage Data设置的位置查找问题
Finding the "Coverage Data" Setting in Xcode 9.3
Hey there! Let me break down exactly where to locate this setting, and why it might be hidden in your projects.
Step-by-Step to Find the Setting
- Open your Xcode project, and make sure you've selected the specific target you want to configure (not the top-level project icon—this is a super common mistake!)
- Switch to the
Build Settingstab at the top of the editor pane - Use the search bar in the top-right corner of the Build Settings window and type
Coverage Datadirectly—this will filter the list to show the option immediately - If you prefer browsing manually, scroll down to the
Build Optionssection; you'll findCoverage Datalisted there as a toggleable setting
Why It Might Be Missing
If you can't see the option at all, check these quick fixes:
- Check your Build Settings filter: Make sure the dropdown at the top-left of the Build Settings tab is set to
All(notBasicorCustomized—these hide less commonly used settings by default) - Confirm your target type:
Coverage Datais available for iOS, tvOS, watchOS, and macOS targets in Xcode 9.3, but double-check you're not looking at a specialized framework target that has restricted build settings - Verify via command line: If the UI still doesn't show it, open Terminal and run this command (replace
YourTargetNamewith your actual target name):
This will confirm if the setting exists for your target—if it returns a value, the issue is just with the Xcode UI filtering.xcodebuild -showBuildSettings -target YourTargetName | grep COVERAGE_DATA
One quick side note: Even if you enable Coverage Data in Build Settings, you'll still need to turn on code coverage in your test scheme (under Edit Scheme > Test > Options > Gather coverage data) to actually collect coverage reports.
内容的提问来源于stack exchange,提问作者user2924482
相关产品推荐
相关产品推荐

