Skip to content

Commit

Permalink
[FIXED JENKINS-9831] Clear emulator logs before creating first snapshot.
Browse files Browse the repository at this point in the history
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 0e9e7cc
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -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) {
Expand Down

0 comments on commit 0e9e7cc

Please sign in to comment.