few command line tools for help android development

33
F ew command line tools f or help andr oid development The slide for Shinjuk u.aar by tomorrowkey July. 28, 2016 ©tomorrowkey 2016 1

Upload: tomoki-yamashita

Post on 16-Apr-2017

913 views

Category:

Internet


1 download

TRANSCRIPT

Few command line tools forhelp android development

The slide for Shinjuku.aarby tomorrowkeyJuly. 28, 2016

©tomorrowkey 2016 1

Personal introduction

©tomorrowkey 2016 2

Who am I?

4 @tomorrowkey

4 http://tomorrowkey.hatenablog.jp/

4 Work for Cookpad as Android and Rails Engineer

4 Pokémon GO

4 Lv13 Team Mystic !

©tomorrowkey 2016 3

Google Play

Few apps published on Google Play.https://play.google.com/store/apps/developer?id=tomorrowkey

©tomorrowkey 2016 4

At first,I have a question.

©tomorrowkey 2016 5

Do you guysuse command line tools forAndroid development?©tomorrowkey 2016 6

Reliable 7 buddies

©tomorrowkey 2016 7

4 adb-peco

4 pidcat

4 installapp

4 uninstallapp

4 clearapp

4 screenshot

4 notifier-plugin

©tomorrowkey 2016 8

Choose a device by pecowhen you fire adb command

©tomorrowkey 2016 9

Have you face following suck message? !more than one device and emulator

You don't have to care since you use adb-peco.

©tomorrowkey 2016 10

InstallationRe-implements with Ruby ✨

gem install adb-peco

It may not work on Windows...

Welcome to contribute on https://github.com/tomorrowkey/adb-peco

©tomorrowkey 2016 11

Show logcat with color

©tomorrowkey 2016 12

Before

©tomorrowkey 2016 13

After

©tomorrowkey 2016 14

FeaturesShow all logs with color

pidcat

Specify application id like following.

pidcat jp.tomorrowkey.android.hogeapp

©tomorrowkey 2016 15

Tipspidcat can be received logcat from pipe input. So I combinate pidcat, adb-peco, pm and peco.function logcat() { local package=$(adb-peco shell pm list packages | sed s/package:// | peco) adb-peco logcat | pidcat $package}

©tomorrowkey 2016 16

Installationbrew install pidcat

https://github.com/JakeWharton/pidcat

©tomorrowkey 2016 17

And the others.

©tomorrowkey 2016 18

installapp, uninstallapp, clearapp, screenshotalias installapp='find ./ -name *.apk | peco | xargs adb-peco install'alias uninstallapp='adb-peco shell pm list packages | sed s/package:// | peco | xargs adb-peco uninstall'alias screenshot='adb-peco screenshot2 $HOME/Desktop/screenshot.png && open $HOME/Desktop/screenshot.png'alias clearapp='adb-peco shell pm list packages | sed s/package:// | peco | xargs adb-peco shell pm clear'

©tomorrowkey 2016 19

Messy !©tomorrowkey 2016 20

Assemble in a command !

©tomorrowkey 2016 21

android-command-line-toolsandroid-command-line-tools installandroid-command-line-tools uninstallandroid-command-line-tools screenshotandroid-command-line-tools clear

©tomorrowkey 2016 22

+2android-command-line-tools screenrecord# android-command-line-tools launch avd

©tomorrowkey 2016 23

Installationgem install android-command-line-tools

https://github.com/tomorrowkey/android-command-line-tools

This tool is still in under development. It might be changed without notice.

©tomorrowkey 2016 24

AliasThis command is too long for daily use. recommend to make an alias like following.

alias hoge='android-command-line-tools'

If you invent a good alias name. let me know !

©tomorrowkey 2016 25

Cats go meow when build completed !

©tomorrowkey 2016 26

Android apps build isSOOOOOOOOOOO

LONG !©tomorrowkey 2016 27

You guys busy on Twitter and Pokémon while building

app anyway !

©tomorrowkey 2016 28

It tell us that the build completed

in the visual ! and at the hearing "

©tomorrowkey 2016 29

Installation (1/2)build.gradlebuildscript { repositories { mavenCentral() } dependencies { classpath 'jp.tomorrowkey.gradle.notifier:notifier-plugin:1.0.1' }}

app/build.gradleapply plugin: 'notifier-plugin'

©tomorrowkey 2016 30

Installation (2/2)notifier.propertiesvoice.enabled=truevoice.name=Alex

notificationCenter.enabled=true

sound.enabled=falsesound.url=file:///Users/tomorrowkey/Desktop/meow.mp3

beep.enabled=falsebeep.count=5

©tomorrowkey 2016 31

That's all! Conclusion

©tomorrowkey 2016 32

ConclusionAndroid app development sometime annoy me.Also I continue to make helpful tools.Let me know if you have a trouble.

©tomorrowkey 2016 33