Method: Apu::MainApp#manage_opts

Defined in:
lib/apu.rb

#manage_optsObject

Manage options



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/apu.rb', line 39

def manage_opts

  if @require_analyses
    # instatiate android project
    android_project = AndroidProject.new(@app_path)

    # is a valid android project?
    unless android_project.is_valid
      puts "#{@app_path.red} is not a valid android project"
      exit
    end
  end

  if @package_flag
    puts android_project.get_package_name.green
  end

  if @uninstall_flag
    android_project.uninstall_application
  end

  if @install_flag
    android_project.install
  end

  if @android_home_flag
    puts android_home_is_defined
  end

  if @launcher_flag
    puts android_project.get_launchable_activity.green
  end

  if @android_studio_flag
    system('open -a Android\ Studio ' + @app_path)
  end

  if @run_flag
    #android_project.install
    system(android_project.get_execute_line)
  end

  if @clear_flag
    android_project.clear_app_data
  end
end