Android Studio - No Target Device Found

萝らか妹 提交于 2020-05-23 04:12:03

问题


I'm having trouble getting an Android app that I developed working on my phone. (Android Studio on Windows 7 trying to run the app on Samsung Note 3 running Android 5.0)

Here's what I've done so far:

  • Turned on USB debugging and allowed unknown sources
  • Installed Google USB Driver
  • Restarted computer
  • Tried updating the driver for the phone but no updates were available
  • Turned on debugging in the build.gradle file

and yet it is still returning Error running app: No target device found

I have also tried the dialog option for when I run the app but that says No USB devices or running emulators detected

Is there anything I have missed?

Thanks in advance!


回答1:


  1. Go to Run in the toolbar.
  2. Select Edit Configurations..
  3. On the left panel, you'll see your application (app). On the right under Deployment Target Options choose Target as Open Select Deployment Target Dialog option. And the other option as it is.



回答2:


I ended up downloading the official Samsung ADB from here: http://developer.samsung.com/technical-doc/view.do?v=T000000117

And it worked great after that. Thanks everyone!




回答3:


On the phone

  1. Have you enabled Developer Mode?

  2. Have you enabled USB debugging within the Developer Tools menu in settings (this menu doesn't appear unless you've enabled Developer Mode)

  3. Do you have a good and securely connected USB cable?

In Android Studio

  1. In Edit Run/Debug Configurations, do you have "Target: USB Device"?

  2. It seems to help me to press the "Attach debugger to Android process" icon (a tall rectangle with a green beetle) and cancelling before pressing the "Debug app" icon

In Windows

  1. It's helpful to know whether your phone appears as a recognised device. If you navigate to "ThisPC", (a level above C:), do you see it there?

  2. Joel Gritter said he solved this issue by downloading the latest official Samsung ADB, see his answer.




回答4:


For those who have tried all of the above as I did, to no avail, you can also force kill the adb.exe in task manager. I had over 40 tries to force close. After that, I restarted the adb to run my app and BOOM. Everything was cool again.



来源:https://stackoverflow.com/questions/40022679/android-studio-no-target-device-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!