class Dryrun::InstallApplicationCommand

Public Instance Methods

get_execution_command_line(package, launcher_activity) click to toggle source
# File lib/dryrun/install_application_command.rb, line 24
def get_execution_command_line(package, launcher_activity)
  "am start -n \"#{launcheable_activity(package, launcher_activity)}\" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER"
end
launcheable_activity(package, launcher_activity) click to toggle source
# File lib/dryrun/install_application_command.rb, line 28
def launcheable_activity(package, launcher_activity)
  full_path_to_launcher = "#{package}#{launcher_activity.gsub(package, '')}"
  "#{package}/#{full_path_to_launcher}"
end
run(builder, package, launcher_activity, custom_module, flavour, device) click to toggle source
# File lib/dryrun/install_application_command.rb, line 7
def run(builder, package, launcher_activity, custom_module, flavour, device)
  execute_line = get_execution_command_line(package, launcher_activity)
  builder.clean

  if device.nil?
    puts 'No devices picked/available, proceeding with assemble instead'.green
    builder.assemble(custom_module, flavour)
  else
    builder.install(custom_module, flavour)
  end

  unless device.nil?
    AndroidUtils.clear_app_data(package)
    AndroidUtils.pretty_run(execute_line, package)
  end
end