[備忘録] androidメモ

# adbのパスを通す

Androidフォルダの在り処を検索

```
$ find /Users/XXXX/ -type d -name "Android"
```

SDKの中身（ちょっと覗いてみた）

```
$ pwd
/Users/XXXX/Library/Android/sdk

$ ls -lsa
total 32
 0 drwxr-xr-x  16 XXXX  staff   544 Apr  3 17:47 .
 0 drwxr-xr-x   4 XXXX  staff   136 Apr  3 18:19 ..
24 -rw-r--r--@  1 XXXX  staff  8196 Apr  3 18:19 .DS_Store
 8 -rw-r--r--   1 XXXX  staff    16 Apr 17 14:19 .knownPackages
 0 drwxr-xr-x   5 XXXX  staff   170 Apr  3 14:23 build-tools
 0 drwxr-xr-x  17 XXXX  staff   578 Mar 21 11:42 emulator
 0 drwxr-xr-x   7 XXXX  staff   238 Apr  3 17:47 extras
 0 drwxr-xr-x   3 XXXX  staff   102 Apr  3 13:37 fonts
 0 drwxr-xr-x   3 XXXX  staff   102 Apr  3 13:05 licenses
 0 drwxr-xr-x   3 XXXX  staff   102 Mar 21 11:42 patcher
 0 drwxr-xr-x  19 XXXX  staff   646 Mar 21 11:43 platform-tools
 0 drwxr-xr-x   8 XXXX  staff   272 Apr  3 17:47 platforms
 0 drwxr-xr-x  23 XXXX  staff   782 Apr  3 14:38 skins
 0 drwxr-xr-x   7 XXXX  staff   238 Apr  3 17:47 sources
 0 drwxr-xr-x   3 XXXX  staff   102 Apr  3 14:26 system-images
 0 drwxr-xr-x  14 XXXX  staff   476 Mar 21 11:42 tools
```

ちなみに、ライブラリー（モジュール）らとかはここにあった。

```
$ ls -lsa ~/.gradle/caches/modules-2/files-2.1/
total 0
0 drwxr-xr-x  30 XXX  staff  1020 Apr 17 08:08 .
0 drwxr-xr-x   6 XXX  staff   204 Apr  3 14:23 ..
0 drwxr-xr-x   5 XXX  staff   170 Apr  7 00:28 android.arch.core
0 drwxr-xr-x   8 XXX  staff   272 Apr  7 00:28 android.arch.lifecycle
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:28 android.arch.persistence
0 drwxr-xr-x   7 XXX  staff   238 Apr  7 00:28 android.arch.persistence.room
0 drwxr-xr-x  17 XXX  staff   578 Apr  7 00:28 com.android.support
0 drwxr-xr-x   4 XXX  staff   136 Apr  3 13:06 com.android.support.test
0 drwxr-xr-x   6 XXX  staff   204 Apr  7 00:28 com.android.support.test.espresso
0 drwxr-xr-x   3 XXX  staff   102 Apr 17 08:08 com.github.bumptech.glide
0 drwxr-xr-x   3 XXX  staff   102 Apr  7 00:29 com.google.android.apps.common.testing.accessibility.framework
0 drwxr-xr-x   3 XXX  staff   102 Apr  3 13:06 com.google.code.findbugs
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:29 com.google.code.gson
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:29 com.jakewharton.android.repackaged
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:28 com.linkedin.dexmaker
0 drwxr-xr-x   3 XXX  staff   102 Apr 17 08:08 com.lorentzos.swipecards
0 drwxr-xr-x   3 XXX  staff   102 Apr  3 16:14 com.neenbedankt.gradle.plugins
0 drwxr-xr-x   3 XXX  staff   102 Apr  3 13:06 com.squareup
0 drwxr-xr-x   5 XXX  staff   170 Apr 17 08:08 com.squareup.okhttp3
0 drwxr-xr-x   4 XXX  staff   136 Apr 17 08:08 com.squareup.okio
0 drwxr-xr-x   6 XXX  staff   204 Apr 17 08:08 com.squareup.retrofit2
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:28 io.reactivex.rxjava2
0 drwxr-xr-x   3 XXX  staff   102 Apr  3 13:06 javax.inject
0 drwxr-xr-x   3 XXX  staff   102 Apr  3 13:06 junit
0 drwxr-xr-x   5 XXX  staff   170 Apr  7 00:29 net.bytebuddy
0 drwxr-xr-x   7 XXX  staff   238 Apr  7 00:29 org.hamcrest
0 drwxr-xr-x   3 XXX  staff   102 Apr  7 00:29 org.jetbrains.kotlin
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:29 org.mockito
0 drwxr-xr-x   4 XXX  staff   136 Apr  7 00:29 org.objenesis
0 drwxr-xr-x   3 XXX  staff   102 Apr  7 00:28 org.reactivestreams
```

adbのパスを通す（zshで打てるようにする）

```
$ echo 'export PATH="$PATH:/Users/XXXX/Library/Android/sdk/platform-tools"' >> ~/.zshrc

$ source ~/.zshrc
```

ちょっとテスト

```
$ adb //説明
$ db devices //接続されている端末の状態

// android端末マネージャーの起動確認
$ adb kill-server
$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
```

#### SDK Platform のバージョンの調べ方
```
➜  ~ ll /Users/XXXX/Library/Android/sdk/platforms
total 0
drwxr-xr-x  14 XXXX  staff   476B  4  3 17:47 android-23
drwxr-xr-x  15 XXXX  staff   510B  4  3 17:47 android-24
drwxr-xr-x  15 XXXX  staff   510B  4  3 17:47 android-25
drwxr-xr-x  15 XXXX  staff   510B  4  3 17:47 android-26
drwxr-xr-x  15 XXXX  staff   510B  4  3 17:47 android-27
```

<hr />

- [androidのgradleの備忘録](https://qiita.com/izuki_y/items/5de57db9acb3b24cb77e)