In Xcode Instruments, how to #import a UIAutomation script that is listed under the "Scripts" section?

In the currentFile.js, I tried doing #import "functionsToImport.js". It didn't work, so I moved the file to my desktop and changed the import to #import "~/desktop/fcns.js" but neither of the solutions works

有帮助吗?

解决方案

Choose Automation -> Add -> Import and import your script file from the file system.

Doing like so will link the Instruments document to your script file, so when you use the #import keyword, it will look in the directory relative to where your script file resides.

Note that you have to import both js files to Instruments to work properly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top