New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android image: Make SDK tools version configurable #5049

Closed
schildbach opened this Issue Nov 3, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@schildbach
Copy link

schildbach commented Nov 3, 2015

Currently you can either accept the default (24.0.0, which is quite outdated).

Or, you can specify tools in the components section to indicate you want the latest version. However, this practice stands in the way of reproducable builds.

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Nov 3, 2015

I looked at the code involved in more detail, and I believe that component names should be passed through to the command android update sdk --no-ui --all --filter …. It appears to me that spawn android update sdk --no-ui --all --filter tools-24.4.1 is not a valid invocation for the tool.

How do you specify the tools version on the command line?

@schildbach

This comment has been minimized.

Copy link

schildbach commented Nov 3, 2015

Even the tools keyword is not known to android update.

I get

Error: Ignoring unknown package filter 'tools'

There must be some special casing.

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Nov 4, 2015

@schildbach That looks strange. Could you point to a build log URL that shows this? If you prefer not to disclose that information, please email us at support@travis-ci.com. Thanks.

@schildbach

This comment has been minimized.

Copy link

schildbach commented Nov 4, 2015

@BanzaiMan Just some clarification. If I specify tools like in this .travis.yml I get revision 24.4.1 (build log). However I think it will magically upgrade to 24.4.2/25.0/etc if Google releases new versions. That's not what I want. I'd like to pin the build to a specific version in order to stay reproducible in future.

The tools seems to be somewhat a special case for Travis. Because if I run android update sdk --no-ui --filter tools locally, I get

Error: Ignoring unknown package filter 'tools'
Warning: The package filter removed all packages. There is nothing to install.
         Please consider trying to update again without a package filter.
@ardock

This comment has been minimized.

Copy link

ardock commented Nov 8, 2015

android -h update sdk

       Usage:
       android [global options] update sdk [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                     Action "update sdk":
  Updates the SDK by suggesting new platforms to install if available.
Options:
     --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
     --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
  -s --no-https  : Uses HTTP instead of HTTPS (the default) for downloads.
  -a --all       : Includes all packages (such as obsolete and non-dependent
                   ones.)
  -f --force     : Forces replacement of a package or its parts, even if
                   something has been modified.
  -u --no-ui     : Updates from command-line (does not display the GUI)
  -p --obsolete  : Deprecated. Please use --all instead.
  -t --filter    : A filter that limits the update to the specified types of
                   packages in the form of a comma-separated list of
                   [platform, system-image, tool, platform-tool, doc, sample,
                   source]. This also accepts the identifiers returned by
                   'list sdk --extended'.
  -n --dry-mode  : Simulates the update but does not download or install
                   anything.

android update sdk -u -n -t tools

Error: Ignoring unknown package filter 'tools'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.

Note: it's not suggested because it's already installed and up-to-date

android update sdk -u -n -t tool

Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Dry mode is on so nothing is actually being installed.

android update sdk -u -n -a -t tool or android update sdk -u -n -a -t tools

Packages selected for install:

  • Android SDK Tools, revision 24.4.1

Dry mode is on so nothing is actually being installed.

android update sdk -u -n -a -t platform-tool,tool

Packages selected for install:

  • Android SDK Tools, revision 24.4.1
  • Android SDK Platform-tools, revision 23.0.1
  • Android SDK Platform-tools, revision 23.1 rc1

Dry mode is on so nothing is actually being installed.

android update sdk -u -n -a -t 1,2

Packages selected for install:

  • Android SDK Tools, revision 24.4.1
  • Android SDK Platform-tools, revision 23.0.1

This command only offers to update to the latest tools and platform-tools and perhaps a preview. This doesn't depend on travis cookbook and for me it's the expected behavior.

Currently VM only includes one tools version and, when is outdated, we can update to the latest version via components. If we need a specific tools version we can use wget to download it, and a phew lines of code to install it.

So you need a script that does it included by default like the wait-for-emulator one or include it in your project, I do this but not for this case (there are a lot of samples in stackoverflow).

- wget http://dl.google.com/android/android-sdk_r[VERSION]-linux.tgz
- tar -xzf android-sdk_r[VERSION]-linux.tgz
- export ANDROID_HOME...

Of course if they include an environment variable that we can use to specify it and they internally download it, better for us.

"http://dl.google.com/android/android-sdk_r#{node['android-sdk']['version']}-linux.tgz"

@schildbach

This comment has been minimized.

Copy link

schildbach commented Nov 8, 2015

Ok I understand. So my wish is better directed at Google. Sadly they won't care. I hope at some time all the Android tools are in the Debian/Ubuntu repositories…

Anyway I'm closing this. It would be nice to at least preinstall 24.4.1 rather than 24.0.0 (see #5048).

Thanks for your time.

@schildbach schildbach closed this Nov 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment