Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21280

Emulator prompts to send usage statistics on every job run with "Keep emulators in the job workspace..." enabled

XMLWordPrintable

      My notes:

      Jenkins killed the job after 15 minutes.

      I increased the job's "Timeout minutes" from 15 to 45 minutes.

      The emulator prompts to send usage statistics to Google on every run. I
      need to find a way to disable that. I don't see that problem after the
      first run when I run the steps ad hoc on my own machine. I bet seeing it
      is an artifact of how cleanly the Jenkins Android Emulator Plugin starts
      the emulator on every run. I hope there's a way to turn it off without
      compromising on starting from a clean state.

      The prompt comes from DDMS. The presence of a `ddms.cfg` file in
      `$ANDROID_SDK_HOME/.android` with the contents below prevents the
      prompt.

          #Wed Jan 08 10:23:13 EST 2014
          pingId=2977280607391965849
      

      The Jenkins Android Emulator Plugin has code that's clearly intended to
      set up `ddms.cfg` with `pingOptIn=false`. Is that not sufficient? Is it
      not executing? Is something else cleaning up `ddms.cfg` after it
      executes?

      I deleted the `.android` directory in the Jenkins job directory and
      re-ran the job. It prompted me to send usage statistics when the
      emulator launched. Before dismissing the dialog, I looked at the newly
      created `.android` directory. It contains a `ddms.cfg` file containing
      only `pingOptIn=false`, just as I would expect from reading the Android
      Emulator Plugin's source code. I suspect that that configuration was
      once sufficient to prevent the dialog and isn't sufficient anymore. It
      seems `pingId` is required now.

      Empirically, the following `ddms.cfg` is sufficient on my machine:

          pingId=0
      

      I should change the Android Emulator Plugin to create `ddms.cfg` with:

          pingOptIn=false
          pingId=0
      

      I expect that will prevent the usage statistics dialog in both old and
      new versions of the Android SDK, assuming that `pingOptIn=false` worked
      in some older version.

      I'm using the following version of `emulator` installed via Android
      Studio 0.4.0:

          $ /Applications/Android\ Studio.app/sdk/tools/emulator -version
          Android emulator version 22.3.0 (build_id OPENMASTER-887826)
          Copyright (C) 2006-2011 The Android Open Source Project and many others.
          This program is a derivative of the QEMU CPU emulator (www.qemu.org).
          
            This software is licensed under the terms of the GNU General Public
            License version 2, as published by the Free Software Foundation, and
            may be copied, distributed, and modified under those terms.
          
            This program is distributed in the hope that it will be useful,
            but WITHOUT ANY WARRANTY; without even the implied warranty of
            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            GNU General Public License for more details.
      

            orrc Christopher Orr
            matthewlmcclure matthewlmcclure
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: