lib/calabash-android/operations.rb in calabash-android-0.4.7.pre2 vs lib/calabash-android/operations.rb in calabash-android-0.4.7.pre3

- old
+ new

@@ -61,10 +61,14 @@ def install_app(app_path) default_device.install_app(app_path) end + def update_app(app_path) + default_device.update_app(app_path) + end + def uninstall_apps default_device.uninstall_app(package_name(default_device.test_server_path)) default_device.uninstall_app(package_name(default_device.app_path)) end @@ -206,9 +210,22 @@ unless succeeded ::Cucumber.wants_to_quit = true raise "#{pn} did not get installed. Aborting!" end + end + + def update_app(app_path) + cmd = "#{adb_command} install -r \"#{app_path}\"" + log "Updating: #{app_path}" + result = `#{cmd}` + log "result: #{result}" + succeeded = result.include?("Success") + + unless succeeded + ::Cucumber.wants_to_quit = true + raise "#{pn} did not get updated. Aborting!" + end end def uninstall_app(package_name) log "Uninstalling: #{package_name}" log `#{adb_command} uninstall #{package_name}`