Skip to content
Permalink
Browse files

[FIXED JENKINS-9831] Clear emulator logs before creating first snapshot.

This prevents all the initial start-up logcat output from being
redundantly included in every subsequent build that uses this snapshot.
  • Loading branch information...
orrc committed Jul 26, 2011
1 parent 06b8cb1 commit 0e9e7cc20aec4c08d9bbcceda218d835e2ca6b54
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
@@ -389,6 +389,15 @@ private Environment doSetUp(final AbstractBuild<?, ?> build, final Launcher laun
log(logger, Messages.WAITING_INITIAL_SNAPSHOT());
Thread.sleep((long) (bootDuration * 0.8));

// Clear main log before creating snapshot
final String clearArgs = String.format("-s %s logcat -c", serial);
ArgumentListBuilder adbCmd = Utils.getToolCommand(androidSdk, isUnix, Tool.ADB, clearArgs);
procStarter.cmds(adbCmd).start().join();
final String msg = "Creating snapshot...";
final String logArgs = String.format("-s %s shell log -p v -t Jenkins '%s'", serial, msg);
adbCmd = Utils.getToolCommand(androidSdk, isUnix, Tool.ADB, logArgs);
procStarter.cmds(adbCmd).start().join();

// Pause execution of the emulator
boolean stopped = sendEmulatorCommand(launcher, logger, userPort, "avd stop");
if (stopped) {

0 comments on commit 0e9e7cc

Please sign in to comment.
You can’t perform that action at this time.