Skip to content

Commit

Permalink
SimLauncher: fix autodetection of app bundle
Browse files Browse the repository at this point in the history
0.17.0 Cannot automatically detect app calabash#959
  • Loading branch information
ark-konopacki committed Jan 6, 2016
2 parents f1fe365 + 15d932b commit 958cd02
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,17 @@ def app_bundle_or_raise(path=nil, device_build_dir='iPhoneSimulator')
puts('-'*37)
end
else
bo_dir = build_output_dir_for_project
sim_dirs = Dir.glob(File.join(bo_dir, '*-iphonesimulator', '*.app'))
search_dir = build_output_dir_for_project || DERIVED_DATA
sim_dirs = ''
apps = `find #{search_dir} -name "*.app" | sort -n`.split("\n")
apps.each do |app_path|
if app_path.split("/")[-2].include('iphonesimulator')
path_to_bin = app_path + "/" + app_path.split("/")[-1].split(".")[0]
if `xcrun strings "#{path_to_bin}" | grep -E 'CALABASH VERSION'`.include? "CALABASH VERSION"
sim_dirs = Dir.glob(app_path)
end
end
end

if sim_dirs.empty?
msg = ['Unable to auto detect APP_BUNDLE_PATH.']
Expand Down

0 comments on commit 958cd02

Please sign in to comment.