Skip to content

Instantly share code, notes, and snippets.

View blazsolar's full-sized avatar

Blaž Šolar blazsolar

View GitHub Profile

Command-line tools

Historically command-line tools for android were downloaded through the android developers webpage. When installed they were used to update other components. The problem with that was that there was no easy way to update command-line tools themself. This was now changed so that they are also distributed through SDK manager.

The issue at the moment is that, if you installed command-line tools through the old system, they won't get updated. So some changes are required for this to happen.

Installing new cmdline-tools

First, we need to install new cmdline-tools, through old sdkmanager.

sdkmanager "cmdline-tools;latest"
@blazsolar
blazsolar / kill-emulators.expect
Last active August 24, 2018 08:23
Handling CI emulators
#!/usr/bin/expect -f
set device [lindex $argv 0]
set token [lindex $argv 1]
spawn telnet localhost $device
expect "OK"
send "auth $token\n"
expect "OK"
send "kill\n"
interact

Keybase proof

I hereby claim:

  • I am blazsolar on github.
  • I am blaz (https://keybase.io/blaz) on keybase.
  • I have a public key whose fingerprint is C759 9153 DEB2 753E FD7F 6F31 4E7E 9536 F2FE 27AC

To claim this, I am signing this object:

@blazsolar
blazsolar / kill-emulators.expect
Last active June 2, 2016 13:51
Killing Android emulator
#!/usr/bin/expect -f
set device [lindex $argv 0]
set token [lindex $argv 1]
spawn telnet localhost $device
expect "OK"
send "auth $token\n"
expect "OK"
send "kill\n"
@blazsolar
blazsolar / gw
Last active September 10, 2015 08:07
Replace ./gradlew with gw command
#/bin/bash
eval "$(pwd)/gradlew $@"
@blazsolar
blazsolar / gist:f635855bfd0a97171dbb
Created January 28, 2015 08:33
Removing meta data from images to fix android build tools libpng warning.
brew install exiftool
find . -path '*src/main/res/*' -name '*.png' -exec exiftool -overwrite_original -all= {} \;
@blazsolar
blazsolar / build.gradle
Last active August 29, 2015 14:00
Android lint configuration for crashlytics plugin
android {
lintOptions {
lintConfig file("lint.xml")
}
}
@blazsolar
blazsolar / CheckableRelativeLayout.java
Created February 19, 2014 16:55
Android RelativeLayout with Checkable so it can be used in ListView CHOICE_MODE_SINGLE or CHOICE_MODE_MULTIPLE
package com.wefika.pro.widgets;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.RelativeLayout;
/**
* Created by Blaž Šolar on 7/17/13.
*/
public class PodatkiOPotnikih<E extends Potnik> {
private HashMap<Integer, Clen> elements;
public PodatkiOPotnikih() {
elements = new HashMap<>();
}
public PodatkiOPotnikih(Collection<E> col) {