[Appium - iOS] The .trace file gets blank after running a test suite takes more than about 7 minutes to finish

I’m using Xcode Instruments (Activity Monitor template) along with appium in order to get CPU and Memory usages. When running a the test suite which takes less than 7 minutes to finish, the instruments trace file (.trace file) is generated correctly with data. However, when running a test suite which takes more than 7 minutes to finish, the .trace file is empty.

Is there anyone have any idea on this?

I started appium server by the following command:
appium -k --tracetemplate MyTemplate --trace-dir appium_instruments -g appium.log --log-timestamp

Test device: iPhone 6s (ios 9.0)
Appium server version: 1.4.14
OS version: OS X El Capitan 10.11.1
XCode version: 7.1.1

Here is the appium log:

  • When success:

2015-11-26 06:28:52:437 - info: Shutting down appium session 2015-11-26 06:28:52:437 - info: [debug] Stopping ios 2015-11-26 06:28:52:438 - info: [debug] Destroying instruments client socket. 2015-11-26 06:28:52:438 - info: [debug] Closing socket server. 2015-11-26 06:28:52:439 - info: [debug] Instruments socket server was closed 2015-11-26 06:28:52:440 - info: [debug] Sending sigterm to instruments 2015-11-26 06:28:52:453 - info: [debug] [INST] 2015-11-26 06:28:52 +0000 Stopped: Script was stopped by the user 2015-11-26 06:28:52:561 - info: [debug] [INST STDERR] 2015-11-26 13:28:52.560 instruments[9895:124577] Attempting to change event horizon while disengage 2015-11-26 06:28:53:329 - info: [debug] [INST] Instruments Trace Complete (Duration : 97.227699s; Output : /Users/$user/$project/instruments/2015-11-26_13-27-08-875/instrumentscli0.trace) 2015-11-26 06:28:53:357 - info: [debug] [INSTSERVER] Instruments exited with code 0

  • When failing:

2015-11-26 06:52:25:490 - info: Shutting down appium session 2015-11-26 06:52:25:491 - info: [debug] Stopping ios 2015-11-26 06:52:25:491 - info: [debug] Destroying instruments client socket. 2015-11-26 06:52:25:492 - info: [debug] Closing socket server. 2015-11-26 06:52:25:493 - info: [debug] Instruments socket server was closed 2015-11-26 06:52:25:494 - info: [debug] Sending sigterm to instruments 2015-11-26 06:52:25:543 - info: [debug] [INST] 2015-11-26 06:52:25 +0000 Stopped: Script was stopped by the user 2015-11-26 06:52:25:650 - info: [debug] [INST STDERR] 2015-11-26 13:52:25.650 instruments[10970:139172] Attempting to change event horizon while disengage 2015-11-26 06:52:28:499 - info: [debug] Instruments didn’t terminate after 3 seconds; trying to kill it 2015-11-26 06:52:28:499 - info: [debug] Killall instruments 2015-11-26 06:52:28:558 - info: [debug] [INSTSERVER] Instruments exited with code null

Thanks in advance!