Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Xcode 6 issue #76

Open
vincentjames501 opened this issue Sep 22, 2014 · 14 comments
Open

Xcode 6 issue #76

vincentjames501 opened this issue Sep 22, 2014 · 14 comments
Assignees

Comments

@vincentjames501
Copy link

At least for my two machines, there is no longer a full path to Automation.tracetemplate. Running xcrun instruments -s I'm left with the following templates:

Known Templates:
"Activity Monitor"
"Allocations"
"Automation"
"Blank"
"Cocoa Layout"
"Core Animation"
"Core Data"
"Counters"
"Dispatch"
"Energy Diagnostics"
"File Activity"
"GPU Driver"
"Leaks"
"Multicore"
"Network"
"OpenGL ES Analysis"
"Sudden Termination"
"System Trace"
"System Usage"
"Time Profiler"
"UI Recorder"
"Zombies"

I haven't done much digging into this, but it runs fine for me if I adjust the [-t template] option via a slight code tweak like so:

def path_to_automation_template
  template = nil
  `xcrun instruments -s 2>&1 | grep Automation.tracetemplate`.split("\n").each do |path|
    path = path.gsub(/^\s*"|",\s*$/, "")
    template = path if File.exists?(path)
    break if template
  end
  template || 'Automation' #ADDED HERE
end

We're back in business. I'm not sure if it's safe to assume this as a default, however. Without this, you'll get the following error message:

2014-09-22 17:21:22.000 instruments[9053:1007] *** -[__NSCFConstantString stringByAppendingPathExtension:]: cannot append extension 'tracetemplate' to path ''
Instruments Usage Error : The specified template '' does not exist.
instruments, version 6.0 (56156)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
@listrophy
Copy link
Contributor

Downloading Xcode 6.0.1 is taking for...ev...er... :)

Thanks for the bug report. I'll see what I can do.

@russelCrowe
Copy link

Having the same problem here as well.

@vincentjames501
Copy link
Author

I'm NOT a ruby expert which is why I'm not just submitting a pull request, but this seems like this would be nice???

def xcode_version
  Gem::Version.new `xcodebuild -version 2>&1`.split("\n").first.gsub(/Xcode /, "")
end

def path_to_automation_template
  if xcode_version >= Gem::Version.new("6")
    "Automation"
  else
    `xcrun instruments -s 2>&1 | grep Automation.tracetemplate`.split("\n").find do |path|
      path = path.gsub(/^\s*"|",\s*$/, "")
      File.exists?(path)
    end
  end
end

@dereknex
Copy link

Having the same problem.

@listrophy listrophy self-assigned this Sep 26, 2014
@listrophy
Copy link
Contributor

@vincentjames501 @russelCrowe @dereknex please install the version of bwoken I just pushed:

Using Bundler, set the line in your Gemfile to:

gem 'bwoken', '2.1.0.rc.1'

If you just installed bwoken from the command line, do the following:

$ gem uninstall bwoken && gem install bwoken --pre

Let me know if this fixes the problem.

(For reference, the fix is at 227d405)

@russelCrowe
Copy link

@listrophy

Thanks. Unfortunately, it's still failing to run the test. It's not throwing any errors this time though. Just fails to launch the simulator.

It compiles fine and tries to run the example.js and main.js but nothing happens. Fails silently.

Appreciate your help.

@liangfenxiaodao
Copy link

@listrophy I got the same problem as @russelCrowe

@bodhi
Copy link

bodhi commented Oct 9, 2014

It's not throwing any errors this time though. Just fails to launch the simulator.

+1

@danielrampanelli
Copy link
Contributor

I did manage to avoid this problem and the fix can found at #79. Apparently, instruments will default to it's first available device (in my case the computer itself) and therefore fails to run the test.

@listrophy
Copy link
Contributor

I've merged #79 and released version 2.1.0.rc.2. Please test with the new version per my instructions above: #76 (comment)

@dereknex
Copy link

@listrophy
Thanks. I upgrade to 2.1.0.rc.2, this problem has been solved

@extr3mal
Copy link

$bwoken --version
2.1.0.rc.2

when running bwoken i recieve

2014-10-23 09:32:14.346 instruments[6522:25752] *** -[__NSCFConstantString stringByAppendingPathExtension:]: cannot append extension 'tracetemplate' to path ''
Instruments Usage Error : The specified template '' does not exist.
instruments, version 6.1 (56160)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
2014-10-23 09:32:17.725 instruments[6536:25796] *** -[__NSCFConstantString stringByAppendingPathExtension:]: cannot append extension 'tracetemplate' to path ''
Instruments Usage Error : The specified template '' does not exist.
instruments, version 6.1 (56160)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

Any ideas how to fix that ?

@jmoody
Copy link

jmoody commented Mar 6, 2015

I stumbled across this searching for something else.

This is how we find the Automation template in run-loop (Calabash iOS).

Works on Xcode > 5.1.1 and is updated for Xcode 6.3 Beta

@truebit
Copy link

truebit commented May 14, 2015

When this bug will be fixed? It still exists on Xcode 6.3.1 with bwoken 2.1.0.rc.2:

Instruments Usage Error : Specified target process is invalid: /Users/some/Documents/bwoken/Workspace/build/iphonesimulator/Some.app
instruments, version 6.3 (57536)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants