问题
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 allowedunknown sources
- Installed
Google USB Driver
- Restarted computer
- Tried
updating the driver
for the phone but no updates were available - Turned on
debugging
in thebuild.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:
- Go to Run in the toolbar.
- Select Edit Configurations..
- 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
Have you enabled Developer Mode?
Have you enabled USB debugging within the Developer Tools menu in settings (this menu doesn't appear unless you've enabled Developer Mode)
Do you have a good and securely connected USB cable?
In Android Studio
In Edit Run/Debug Configurations, do you have "Target: USB Device"?
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
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?
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