From 517d3618948ab292d7621591e2df5bdfd91015e2 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Tue, 16 Sep 2014 17:26:28 +0900 Subject: [PATCH] =?UTF-8?q?=E2=80=9Crake=20emulator=E2=80=9D=20now=20requi?= =?UTF-8?q?res=20a=20started=20AVD=20and=20will=20not=20attempt=20at=20cre?= =?UTF-8?q?ating=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/motion/project/template/android.rb | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/motion/project/template/android.rb b/lib/motion/project/template/android.rb index e4c022ec..7fa18315 100644 --- a/lib/motion/project/template/android.rb +++ b/lib/motion/project/template/android.rb @@ -468,31 +468,13 @@ def run_apk(mode) end namespace 'emulator' do - desc "Create the Android Virtual Device for the emulator" - task :create_avd do - all_targets = `\"#{App.config.sdk_path}/tools/android\" list avd --compact`.split(/\n/) - if !all_targets.include?(App.config.avd_config[:name]) - sh "/bin/echo -n \"no\" | \"#{App.config.sdk_path}/tools/android\" create avd --name \"#{App.config.avd_config[:name]}\" --target \"#{App.config.avd_config[:target]}\" --abi \"#{App.config.avd_config[:abi]}\" --snapshot" - end - end - - desc "Start the emulator in the background" - task :start_avd do - avd = (ENV['avd'] || App.config.avd_config[:name]) - unless `/bin/ps -a`.split(/\n/).any? { |x| x.include?('emulator64-arm') and x.include?(avd) } - Rake::Task["emulator:create_avd"].invoke - sh "\"#{App.config.sdk_path}/tools/emulator\" -avd \"#{avd}\" &" - sh "\"#{App.config.sdk_path}/platform-tools/adb\" -e wait-for-device" - end - end - desc "Install the app in the emulator" task :install do install_apk(:emulator) end desc "Start the app's main intent in the emulator" - task :start => ['build', 'emulator:start_avd', 'emulator:install'] do + task :start => ['build', 'emulator:install'] do run_apk(:emulator) end end