xcrun xctrace record doesn't work properly

Hi,folks.I just started with XCTrace and before that I used the command-line tools from Instruments.

I don't know if I did something wrong that caused XCTrace to not work properly.

I used a custom template to collect power data and use appium to get the PID,but it couldn't attach process and throws error message

When I use --all-process parameter to record power consumption data, it works.

Xcode version:Xcode12 beta 5

xcrun xctrace record --template /Users/aaron.lin/Library/Application\ Support/Instruments/Templates/BatteryTest.tracetemplate --device b234eb8342b7dbf954d724c7d87da1e7721e8733 --output ./target/iosPerformance/BatteryTest.trace --time-limit 1800000ms --attach 865

Code Block
<p>
2020-09-08 16:06:47.390 xctrace[48276:3335869] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.143.2/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: templateEnergyDiagnostics1_48
Object: <XRTheme>
Method: +imageNamed:
Thread: <NSThread: 0x7fe9d3509bb0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2020-09-08 16:06:47.406 xctrace[48276:3335869] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.143.2/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: iPhonePowerTemplates
Object: <XRTheme>
Method: +imageNamed:
Thread: <NSThread: 0x7fe9d3509bb0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2020-09-08 16:06:47.503 xctrace[48276:3335869] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.143.2/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: templateBlank_48
Object: <XRTheme>
Method: +imageNamed:
Thread: <NSThread: 0x7fe9d3509bb0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
Cannot find process for provided pid: 865
<p>


Hi Aaron,

Would you mind sharing your BatteryTest template? I cannot seem to reproduce your issue with Energy Log template.
You should be able to specify name of the process for attaching, like so: --attach 'MyAppName'.

Thanks,

Kacper



Hi @Kacper,
Thanks for your reply, my BatteryTest template is the same as Energy Log template
I just saved it as a custom template for some reason

Aaron
Getting Error for - xcrun xctrace record --template /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Resources/templates/Counters.tracetemplate --device B804EAEC-2CAE-48A4-B669-DAE3269A9145 --output ./Downloads/BatteryTest.trace --time-limit 1800000ms --attach 865

2020-11-05 00:28:43.009 xctrace[18403:344378] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.151/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: templateCounters1_48
Object:  <XRTheme>
Method:  +imageNamed:
Thread:  <NSThread: 0x7fdc1cc19140>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2020-11-05 00:28:43.024 xctrace[18403:344378] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.151/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: Template - Counter
Object:  <XRTheme>
Method:  +imageNamed:
Thread:  <NSThread: 0x7fdc1cc19140>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2020-11-05 00:28:43.093 xctrace[18403:344378] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/Instruments/Instruments-64540.151/Theming/XRTheme.mm:213
Details: Could not access the resource bundle when loading image named: templateBlank_48
Object:  <XRTheme>
Method:  +imageNamed:
Thread:  <NSThread: 0x7fdc1cc19140>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
Cannot find process for provided pid: 865
xcrun xctrace record doesn't work properly
 
 
Q