Class: RestartCommand

Inherits:
Command show all
Defined in:
lib/replicant/commands/restart_command.rb

Constant Summary

Constants included from Styles

Styles::CONSOLE_WIDTH, Styles::REPL_OUT, Styles::STYLES

Instance Attribute Summary

Attributes inherited from Command

#args

Instance Method Summary collapse

Methods inherited from Command

all, #execute, inherited, #initialize, load, #name, #usage

Methods included from Styles

#create_style, #end_style, #styled_text

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#descriptionObject



2
3
4
# File 'lib/replicant/commands/restart_command.rb', line 2

def description
  "restart ADB"
end

#runObject



6
7
8
9
10
11
12
# File 'lib/replicant/commands/restart_command.rb', line 6

def run
  # Faster than kill-server, and also catches ADB instances launched by
  # IntelliJ. Moreover, start-server after kill-server sometimes makes the
  # server fail to start up unless you sleep for a second or so
  `killall adb`
  AdbCommand.new(@repl, "start-server").execute
end