Instrument-Multiple device execution

℡╲_俬逩灬. 提交于 2019-11-30 07:51:00

问题


I am able to run instrument using command line for a single device / simulator, but I need to run it on two devices. Manually I can achieve this by opening two new window of Instruments and make two copy of the js and import it. But I need to achieve this using Command Line. Can anybody help me in achieving this or does anybody have the guidelines for the same?


回答1:


I struggled with this as well here is a part of my solution. What i did is:

Create trace files in instruments with you script .js file pre selected and save it to disk.

Reads the UDID of all connected devices. Loop trough all connected devices and replace the UDID in your trace file with the currenct UDID. In the same loop open instruments.

for line in $(system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'); do
  UDID=${line}
  file$x $(replace 345w67ww89ww0w98w762wewq33e2 with ${UDID})
  open -a Instruments /PATH/TO/TRACE/file$x
done

This solution will open multiple windows of Instruments. You can go trough them with appleScript to click the record button.




回答2:


Another way to achieve it is to open two separate instance of Instrument and execute it



来源:https://stackoverflow.com/questions/12195736/instrument-multiple-device-execution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!