有些电脑安装Studio后启动项目,无法真机和模拟调试,Logcat无连接信息

原因一:没有设置adb环境变量设置

原因二:电脑缺失文件,导致adb无法正常运行,报错

adb.exe 0xc000007b 应用程序无法正常启动

解决方式:

原因一的话,就先去配置环境变量

我的电脑,鼠标右键点击属性

AndroidStudio无法断点 androidstudio程序停止运行_配置环境变量

环境变量设置里--新建一个变量名伟Android_HOME,变量值为SDK安装的目录

AndroidStudio无法断点 androidstudio程序停止运行_配置环境变量_02

然后找到path变量,点击编辑,添加

win10直接添加%ANDROID_HOME%\platform-tools和%ANDROID_HOME%\tools

AndroidStudio无法断点 androidstudio程序停止运行_环境变量设置_03

win7在变量值后边添加    ;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%MAVEN_HOME%\bin;

AndroidStudio无法断点 androidstudio程序停止运行_配置环境变量_04

最后,验证是否安装成功

win键+R按键  输入cmd,进入命令窗口

AndroidStudio无法断点 androidstudio程序停止运行_环境变量设置_05

输入adb

如下配置成功

AndroidStudio无法断点 androidstudio程序停止运行_AndroidStudio无法断点_06

如果配置环境变量后,报错

adb.exe 0xc000007b 应用程序无法正常启动

那么则是系统缺失了部分文件

首先在命令窗口中输入sfc /scannow

让电脑自检下,看能不能修复一些问题,

如果还是不行的话,就去下载vc_redist.x64.exe(根据自己系统下载相应版本)

其下载地址:

AndroidStudio无法断点 androidstudio程序停止运行_重新安装_07

下载安装后,重启电脑,然后在命令行中运行,adb

AndroidStudio无法断点 androidstudio程序停止运行_环境变量设置_08

以上解决了adb的异常问题。

有些机器虽然能连接到模拟机器,但连接不到真机

studio给出结果:

If you want to connect a device for testing, then you need to install the appropriate USB drivers. For more information, read the online documentation.

If your computer does not detect your device, disconnect and reconnect your device, or try using a different USB cable. If the issue persists, click Next below

让我们安装usb驱动,或者是更换数据线

而后在驱动精灵下更新驱动,并没有usb驱动的更新

但在计算机的设备管理器里面发现ADB Interface异常(前提是打开studio,数据线连接到手机,打开数据线的文件传输模式,最好还打开手机的debug调试模式)

adb interface重新安装

1、打开报错的ADB Interface(目前我的电脑以及是重新安装好了的,所以截图都是正常的),点击更新驱动程序

AndroidStudio无法断点 androidstudio程序停止运行_重新安装_09

2、选择第二个,手动查找并安装驱动程序软件

AndroidStudio无法断点 androidstudio程序停止运行_AndroidStudio无法断点_10

3、选择 显示所有设备

AndroidStudio无法断点 androidstudio程序停止运行_配置环境变量_11

4、选择从磁盘安装

AndroidStudio无法断点 androidstudio程序停止运行_重新安装_12

5、磁盘安装选择到文件, sdk安装目录下extras/google/usb_driver/android_winusb.inf,选中这个文件

AndroidStudio无法断点 androidstudio程序停止运行_环境变量设置_13

5、选择确定

AndroidStudio无法断点 androidstudio程序停止运行_环境变量设置_14

7、提示框,不推荐安装,是否选择继续安装,选择是

AndroidStudio无法断点 androidstudio程序停止运行_AndroidStudio无法断点_15

7、安装成功

AndroidStudio无法断点 androidstudio程序停止运行_配置环境变量_16

真机调试完美解决