Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From Baby Yoda to Yoda

From Baby Yoda to Yoda

As Android developers, we are most of the time very proud about the tools we have to work every day, and sometimes not that much.
But also we could not be aware about all the tools we have available, due there are much more than we think.
So, in this session we will show the tools, scripts, potions and spells that will up us to the next level when creating an Android App

Nicolás Patarino

November 04, 2020
Tweet

More Decks by Nicolás Patarino

Other Decks in Technology

Transcript

  1. Suspend Android Studio #!/usr/bin/env bash pkill -SIGSTOP studio printf "------

    Suspending Android Studio ------" gradleCommand="./gradlew ${@}" eval ${gradleCommand} pkill -SIGCONT studio printf "------ Resume Android Studio ------" ./gradlewSuspendAS.sh assembleMockDebug
  2. Suspend Android Studio / Chrome #!/usr/bin/env bash pkill -SIGSTOP studio

    pkill -SIGSTOP "Chrome" printf "------ Suspending AS & Chrome ------" gradleCommand="./gradlew ${@}" eval ${gradleCommand} pkill -SIGCONT studio pkill -SIGCONT "Chrome" printf "------ Resume AS & Chrome ------" ./gradlewSuspendAS.sh assembleMockDebug
  3. int MILLIS_IN_MINUTE = 1000 * 60 int minutesSinceEpoch = System.currentTimeMillis()

    / MILLIS_IN_MINUTE android { ... defaultConfig { versionCode minutesSinceEpoch versionName minutesSinceEpoch.toString() ... } } Dynamic values
  4. int MILLIS_IN_MINUTE = 1000 * 60 int minutesSinceEpoch = System.currentTimeMillis()

    / MILLIS_IN_MINUTE android { ... defaultConfig { versionCode 1 versionName "1.0" ... } applicationVariants.all { variant -> if (variant.buildType.name == "release") { variant.mergedFlavor.versionCode = minutesSinceEpoch; variant.mergedFlavor.versionName = minutesSinceEpoch + "-" + variant.flavorName; } } } Static values for debug
  5. scrcpy brew install scrcpy scrcpy scrcpy --help --always-on-top --bit-rate 2M

    --max-size 1024 --stay-awake --no-display --record file.mp4 --show-touches --no-control Drag and drop. APKs, other files.
  6. ADB commands adb devices List of devices attached 192.168.1.49:38141 device

    emulator-5554 device adb shell list packages | grep movistar adb -s 192.168.1.49:38141 uninstall io.plaidapp Success adb shell screencap -p "/path/to/screenshot.png" adb shell screenrecord "/path/to/record.mp4" adb push <local> <remote> adb pull <remote> <local>
  7. ADB commands adb shell am start -a android.intent.action.VIEW -d {URL}

    {packageName} adb shell am start -D -a android.intent.action.MAIN -n {package}/{activity} adb shell pm reset-permissions adb shell pm grant {packageName} {permission}
  8. adb shell wm density Physical density: 440 adb shell wm

    density 220 adb shell wm density 110 adb shell wm density 880
  9. adb shell wm size Physical size: 1080x2220 adb shell wm

    size 1080x1400 adb shell wm size 800x1920
  10. Makefile make initial-setup make make lint make brand_variant=variant make emulator

    make devsettings make test only=StatusSelectionPresenterTest