lib/calabash-android/operations.rb in calabash-android-0.5.15.coordinate.pre.fix2 vs lib/calabash-android/operations.rb in calabash-android-0.5.15.pre1
- old
+ new
@@ -289,14 +289,10 @@
forward_cmd = "#{adb_command} forward tcp:#{@server_port} tcp:#{@test_server_port}"
log forward_cmd
log `#{forward_cmd}`
end
- def _sdk_version
- `#{adb_command} shell getprop ro.build.version.sdk`.to_i
- end
-
def reinstall_apps
uninstall_app(package_name(@app_path))
uninstall_app(package_name(@test_server_path))
install_app(@app_path)
install_app(@test_server_path)
@@ -306,16 +302,11 @@
uninstall_app(package_name(@test_server_path))
install_app(@test_server_path)
end
def install_app(app_path)
- if _sdk_version >= 23
- cmd = "#{adb_command} install -g \"#{app_path}\""
- else
- cmd = "#{adb_command} install \"#{app_path}\""
- end
-
+ cmd = "#{adb_command} install \"#{app_path}\""
log "Installing: #{app_path}"
result = `#{cmd}`
log result
pn = package_name(app_path)
succeeded = `#{adb_command} shell pm list packages`.lines.map{|line| line.chomp.sub("package:", "")}.include?(pn)
@@ -325,15 +316,10 @@
raise "#{pn} did not get installed. Reason: '#{result.lines.last.chomp}'. Aborting!"
end
end
def update_app(app_path)
- if _sdk_version >= 23
- cmd = "#{adb_command} install -rg \"#{app_path}\""
- else
- cmd = "#{adb_command} install -r \"#{app_path}\""
- end
-
+ cmd = "#{adb_command} install -r \"#{app_path}\""
log "Updating: #{app_path}"
result = `#{cmd}`
log "result: #{result}"
succeeded = result.include?("Success")