Could not find Automation.tracetemplate Xcode6 GM seed OSX10.9.x

Hi,
I have installed Xocde6.0 GM seed. I am also having Xocde5.0. I am using names of Xcodes as (Xcode.app for xocde5) and Xcode 2.app for (xcode6) under my Applications folder.

I built an ipa using xocde6 that runs on iOS7 and iOS8 both.
But, When I try to run my test using appium (v1.2.0) and the above ipa, then I am getting following error.

debug: Removing any remaining instruments sockets
debug: Cleaned up instruments socket /tmp/instruments_sock
debug: Cleaning up any tracedirs

debug: No tracedirs to clean up
debug: Setting Xcode folder
debug: Setting Xcode version

debug: Setting iOS SDK Version

debug: iOS SDK Version set to 8.0

debug: Detecting automation tracetemplate
error: Could not find Automation.tracetemplate in /Applications/Xcode 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not find Automation.tracetemplate in /Applications/Xcode 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
info: <-- POST /wd/hub/session 500 1950.375 ms - 512
debug: Error: Could not find Automation.tracetemplate in /Applications/Xcode 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:717:14)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/helpers.js:490:9
at ChildProcess.exithandler (child_process.js:645:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Socket. (child_process.js:968:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
debug: Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find Automation.tracetemplate in /Applications/Xcode 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate)”,“origValue”:“Could not find Automation.tracetemplate in /Applications/Xcode 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate”},“sessionId”:null}

Forgot to mention, I am automating the tests using real devices not simulators.

Please help me out. It’s quite urgent.
Please provide the steps if you have any other way work around to solve it.

Many Thanks in Advance.
Regards
Manish

3 Likes

I have the same problem. which also shows in simulator. looking for solution

I have the same problem ,how to solve this problem

Same here!

Could not find Automation.tracetemplate in /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate

Good people are looking into this issue. Issues regarding ios8 and xcode 6:

3 Likes

###iOS 8 Support is supposed to be released as part of Appium 1.3.

It is a known and fixed issue.
If you are impatient (like I am), you can use the pre-release branch ios8.

You need to run Appium from source. Guide

  1. Use sudo xcode-select --switch path/to/Xcode6.app
  2. cd path/to/appium # This is where you cloned the appium repo to
  3. git checkout ios8
  4. node .

Make sure your desired_capabilties have platformVersion set to 8.0

To use 7.1 with Xcode 6, download the 7.1 simulator from the Xcode preferences and set platformVersion to be 7.1

2 Likes

is the above solution for ios8 is only for simulator?

This is a real quick solution to get things going on( iPhone 6 , real device)

With Xcode 6.0.1, the path to the Automation Instrument template is now:

/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/ AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate

so go to this PATH , from your console $ open /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/ , copy the content of AutomationInstrument.xrplugin and paste it in a folder called AutomationInstrument.bundle which you need to create in the PlugIns folder.

this should solve your first problem, but alongside you also need to modify your capabilities and settings from your device to enable UIAutomation, which is new settings in iOS 8 upgrade and should to be checked to enable UIAutomation
Settings->Developer->Enable UI Automation

Capabilities

      :browserName => "Safari",
      :udid => "YOUR_DEVICE_UDID",
      :platformVersion => '8.0',
      :platformName => "iOS"  ,
      :deviceName =>"iPhone 6" ,

Thanks for the tip @JessicaSachs. It was nice to see the simulator actually launch; however, the xcode_6.1_gm_seed_2 simulator choked on something else.

error Failed to start an Appium session, err was: Error: Instruments crashed on startup

I’m going back to give it another whirl with xcode_6

I’m just trying to run webdriver tests against mobile safari. It’s very possible I’m doing something else wrong. I haven’t spun this up in like a year, and just brushed off the cobwebs today.
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(“platformName”, “iOS”);
cap.setCapability(“platformVersion”, “8.1”);
cap.setCapability(“deviceName”, “iPhone Simulator”);
cap.setCapability(“browserName”, “Safari”);

What’s the first thing that happens when your app launches? do you get a location services alert?

No, I don’t see anything like that, but this probably has something to do with it. I get it with xcode_6 as well, so it’s probably on my end:

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.apple.mobilesafari

I changed my deviceName, per suggestion in the console output, which I can provide if that would be helpful.

            DesiredCapabilities cap = new DesiredCapabilities();
            cap.setCapability("platformName", "iOS");
            cap.setCapability("platformVersion", "8.0");
            cap.setCapability("deviceName", "iPhone 5"); //IPHONE
            cap.setCapability("browserName", "Safari");

Hi,
I found a solution to overcome this.
use the below command and run it on ur terminal. But, change your Xcode path.

ln -sf /Applications/Xcode\ 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/ /Applications/Xcode\ 2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle

HI Craig_Baumgarten

Can you please let us know the solution of this error.
And when will be the Appium 1.3 launched As we are badly stuck in this issue.
Not able to do any work.

Thanks

I am getting the same error

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Users/sujittarun/GitHub/appium/node_modules/appium-instruments/lib/instruments.js:385:31)
at null. (/Users/sujittarun/GitHub/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Instruments crashed on startup)”,“origValue”:“Instruments crashed on startup”},“sessionId”:null}

FYI My issue turned out being with my xcode install. For some reason, Safari wasn’t installed in the simulator. I reinstalled xcode to get it back.