Instrument-Multiple device execution

前端 未结 2 1366
你的背包
你的背包 2020-12-17 06:35

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

2条回答
  •  無奈伤痛
    2020-12-17 07:24

    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.

提交回复
热议问题