34
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ターミナルにadbのパスを通す(Mac)

Last updated at Posted at 2017-01-26

なんのひねりもない記事です。ただ、地味に(特に前半)迷ったのでまとめておく。
単にbashrcに書けばよかった。

Android SDK locationを調べる。
Android Studioを起動、
File->Other Settings->Default Project Structure
SDK Locationをコピー。
だいたい、「/Users/ユーザ名/Library/Android/sdk」

adbコマンドはsdkフォルダのplatform-toolsにあるので、

export PATH=$PATH:/Users/ユーザ名/Library/Android/sdk/platform-tools

をとりあえず叩く。これでadbにパスが通ったはず。USBデバッグを有効にした上でUSBケーブルでスマホをつなぐ。

$adb devices

これ叩いてデバイスがつながっていることが確認できればOK。
あとは次回以降も使えるように、

~/.bashrcに以下を追記する

export PATH=$PATH:/Users/ユーザ名/Library/Android/sdk/platform-tools
source .bashrc

で反映できる。

34
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?