简体   繁体   English

MacBook Pro Mojave,Android Pie,Android 设备被 adb 识别但未被 Android Studio 识别

[英]MacBook Pro Mojave, Android Pie, Android Device is recognized by adb but is not recogniced by Android Studio

why isnt my device detected in Android Studio?为什么 Android Studio 检测不到我的设备?

系统信息

截屏

截屏

i can detect it in adb我可以在 adb 中检测到它

Macs-MacBook-Air:AudioTester mac$ adb devices
List of devices attached
ce091829e258a11b04      device

Macs-MacBook-Air:AudioTester mac$ adb shell
dreamlte:/ $ exit
Macs-MacBook-Air:AudioTester mac$ 

but i cant detect it in Android Studio which makes debugging (and logcat'ing) very difficult as i do not know how to correctly emulate what would normally happen in android studio, on the command line using adb但我无法在 Android Studio 中检测到它,这使得调试(和 logcat'ing)非常困难,因为我不知道如何正确模拟 android Studio 中通常会发生的情况,在命令行上使用 adb

for example例如

Macs-MacBook-Air:AudioTester mac$ adb install app/build/outputs/apk/debug/app-debug.apk
Performing Streamed Install
Success
Macs-MacBook-Air:AudioTester mac$ # somehow start the application automagically
Macs-MacBook-Air:AudioTester mac$ # obtain application pid so i can filter in adb logcat

this is my current env for MacBook Pro这是我当前的 MacBook Pro 环境

Macs-MacBook-Air:AudioTester mac$ env
ANDROID_HOME=/Users/mac/Library/Android/sdk
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/pf/mtx5w525003d7dt_smftxd9h0000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.N5KLQm0rqw/Render
USER=mac
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.cat00ijzkS/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:15
PATH=/usr/local/ActiveGo-1.8.3/bin:/Users/mac/ActiveGo/bin:/usr/local/ActiveGo-1.8.3/gopath/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mac/Library/Android/sdk/cmdline-tools/latest/bin:/Users/mac/Library/Android/sdk/ndk/21.0.6113669:/Users/mac/Library/Android/sdk/platform-tools/platform-tools:/Users/mac/bin:/Users/mac/Library/Application Support/KomodoIDE/12.0/XRE/state
TERMINAL_EMULATOR=JetBrains-JediTerm
PWD=/Users/mac/AndroidStudioProjects/AudioTester
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/mac
LOGNAME=mac
LC_CTYPE=en_AU.UTF-8
GOPATH=/Users/mac/ActiveGo:/usr/local/ActiveGo-1.8.3/gopath
_=/usr/bin/env

and this is my current env for Android这是我当前的 Android 环境

Macs-MacBook-Air:AudioTester mac$ adb shell
dreamlte:/ $ env
_=/system/bin/env
ANDROID_DATA=/data
LOGNAME=shell
HOME=/
ANDROID_STORAGE=/storage
TERM=xterm-256color
TERMINFO=/system/etc/terminfo
ANDROID_BOOTLOGO=1
ANDROID_ASSETS=/system/app
SHELL=/system/bin/sh
BOOTCLASSPATH=/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/framework-oahl-backward-compatibility.jar:/system/framework/android.test.base.jar
ASEC_MOUNTPOINT=/mnt/asec
MC_AUTH_TOKEN_PATH=/efs
ANDROID_SOCKET_adbd=12
HOSTNAME=dreamlte
EXTERNAL_STORAGE=/sdcard
ANDROID_CACHE=/cache
USER=shell
TMPDIR=/data/local/tmp
PATH=/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
SYSTEMSERVERCLASSPATH=/system/framework/org.lineageos.platform.jar:/system/framework/org.lineageos.hardware.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar
ANDROID_ROOT=/system
DOWNLOAD_CACHE=/data/cache
dreamlte:/ $ exit
Macs-MacBook-Air:AudioTester mac$ 

Please check your envirnment variables and make sure that ANDROID_HOME is set to proper directories请检查您的环境变量并确保将 ANDROID_HOME 设置为正确的目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM