LoginSignup
0
0

実機デバックとエミュレーターでのデバックはイコールだと思ってた話

Last updated at Posted at 2024-04-08

【adb: no emulators found】の解決方法

/Users/{おいどん}/Library/Android/sdk/platform-tools/adb -e shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "xxxxxx://user/?admin=1"'

デバックアプリが起動している状態で上記スクリプトを実行すると、ユーザーに権限が付与されるってやつ

adb -devices
おいどん@おいどんのMacmini プロジェクト名 % adb devices
List of devices attached
BH906xxx1      device

ふんふん、デバイスは認識されてるな。
F5デバックでも問題なくアプリ動いてるし、スクリプトながそ〜☺️

/Users/{おいどん}/Library/Android/sdk/platform-tools/adb -e shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "xxxxxx://user/?admin=1"'
adb: no emulators found

は????

とりあえず、脳死で「adb: no emulators found mac」とググる

Android Studioの設定がどうだとか、デバイスのusb接続の設定がどうだとか色々出てくるが
エディタはVScodeを使用していたのでAndroid Studio等の設定は関係ないなーって思った

実機のUSBデバックは当然ONにしてるしファイル転送もオンにしてる

VscodeやMac本体、実機デバイスの再起動したけど変わらなよねー
となるとやっぱスクリプトが間違ってんだろうなー
ここでエミュレーターと実機デバイスってなんか違うんじゃないと思って[-e]の部分を調べてみるとなんと!!
「-d」があるではないか!!!!!

/Users/{おいどん}/Library/Android/sdk/platform-tools/adb -d shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "xxxxxx://user/?admin=1"'

これで思った通りの処理になりましたよ。。。。

エミュレーター ≒ 実機デバイスかと思ってたけど
今後はエミュレーター ≠ 実機デバイスの認識でやっていこうと思う 

0
0
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
0
0