【发布时间】:2014-07-07 19:16:09
【问题描述】:
我上周开始使用 Android Studio (AS)。我为我的手机制作了一个工作应用程序。我现在想在平板电脑上运行它。 AS 没有看到它已连接。 Logcat 说“找不到设备”。
我做了很多研究都无济于事。我的问题是,“我必须做什么才能让 AS 看到我连接的设备?”
我列出了所有我能想象到的相关内容。
- Windows 资源管理器确实可以看到它,并且设备管理器将其称为“便携式设备”。我要求更新它的驱动程序,设备经理告诉我我有最新的。
- 当我连接每个设备时,每个设备屏幕的顶部都会显示“已作为媒体设备连接”和“USB DDebugging 已连接”。
- 在 DOS 中我执行了
adb devices并且手机确实显示但平板电脑没有显示。 - 设备管理器将这两个设备称为“便携式设备”,但它仅将手机称为“ADB 接口”。
我去 Android 开发者论坛询问了这个问题。以前从未去过那里。它是这样说的:
新来的?如果您刚刚开始进行 Android 应用程序开发并且有一个初学者级别的问题,请考虑在 Stack Overflow 上提问。
所以我在这里,寻找与我关注但没有帮助的这些 SO 线程相同的帮助:
- Android Studio doesn't begin with connected device
- Android Studio doesn't see device
我为每个线程安装了最新的 Google USB 驱动程序 (10)。没有帮助。
- 另外,我单击了运行 |编辑配置,对于“目标设备”,我选择了“USB 设备”。没有帮助。
- 另外,我更改了 AndroidManifest.xml 以包含
android:targetSdkVersion="17"。没有帮助。
这里是 AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dov.tablet" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:targetSdkVersion="17"
<activity
android:name=".MyActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这里是 gradle.build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.dov.tablet"
minSdkVersion 17
targetSdkVersion 17
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
我已经做了所有我能想到的事情,但设备就是无法识别。
谁能告诉我下一步该做什么?
【问题讨论】:
-
我假设您在平板电脑上打开了开发者选项,对吗? usb调试等...
-
这就是为什么“USB 调试已连接”显示在设备上的原因,如我的问题的第 2 条中所述。