Skip to content

Commit

Permalink
CLI: simctl doctor erases sims first
Browse files Browse the repository at this point in the history
See #420

Doctor ensures there are no 'hidden' apps
  • Loading branch information
jmoody committed Mar 28, 2016
1 parent 68b5953 commit 2d12167
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/run_loop/cli/simctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,25 @@ def doctor
debug = options[:debug]
device = options[:device]

manage_processes

if device
RunLoop::Environment.with_debugging(debug) do
RunLoop::CoreSimulator.erase(device)
launch_simulator(device, xcode)
end
else
launch_each_simulator
RunLoop::Environment.with_debugging(debug) do
erase_and_launch_each_simulator
end
end

manage_processes
end

no_commands do
def launch_each_simulator
def erase_and_launch_each_simulator
sim_control.simulators.each do |simulator|
RunLoop::CoreSimulator.erase(simulator)
launch_simulator(simulator, xcode)
end
end
Expand Down

0 comments on commit 2d12167

Please sign in to comment.