Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top