Class: Acouchi::ApkInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/acouchi/apk_installer.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ ApkInstaller

Returns a new instance of ApkInstaller.



3
4
5
6
# File 'lib/acouchi/apk_installer.rb', line 3

def initialize configuration
  @configuration = configuration
  @apk_path = File.join(configuration.project_path, "bin", configuration.apk)
end

Instance Method Details

#install_apkObject



8
9
10
11
12
13
14
# File 'lib/acouchi/apk_installer.rb', line 8

def install_apk
  if @configuration.device
    ProcessLauncher.new(Executables.adb,"-s",@configuration.device,"install",@apk_path).start_and_crash_if_process_fails
  else
    ProcessLauncher.new(Executables.adb,"install",@apk_path).start_and_crash_if_process_fails
  end
end

#uninstall_apkObject



16
17
18
19
20
21
22
# File 'lib/acouchi/apk_installer.rb', line 16

def uninstall_apk
  if @configuration.device
    ProcessLauncher.new(Executables.adb,"-s",@configuration.device,"uninstall",@configuration.target_package).start
  else 
    ProcessLauncher.new(Executables.adb,"uninstall",@configuration.target_package).start
  end
end