繁体   English   中英

Android Studio,如何处理adb错误?

[英]Android Studio, how to deal with adb error?

我认为我的问题与adb有关。 我在网上搜索了很多,并尝试将其关闭大约4种不同的方式,没有任何帮助。 我正在使用Mac。 以下是运行我的应用时Android Studio的运行选项卡:

06/16 16:36:06: Launching app
$ adb push /Users/melloo/Desktop/UCI/Intro-to-Mobile-App-Development-with-
Android/A2-Antoniya.Puleva/app/build/outputs/apk/app-debug.apk 
/data/local/tmp/x40240.antoniya.puleva.a2
$ adb shell pm install -r "/data/local/tmp/x40240.antoniya.puleva.a2"
pkg: /data/local/tmp/x40240.antoniya.puleva.a2
Success

$ adb shell am start -n 
"x40240.antoniya.puleva.a2/x40240.antoniya.puleva.a2.MainActivity" -a 
android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 2983 on device Nexus_5X_API_22 [emulator-5554]
Application terminated.

和我的清单:

 <?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:launchMode="standard"
    >
    <activity android:name=".MainActivity"
              android:label="List O'Names">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".NameListActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name = "x40240.antoniya.puleva.intent.action.ACTION_VIEW" />
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="text/plain"/>
        </intent-filter>
    </activity>
</application>

使用Android Studio 3.0 Canary 3时出现类似错误。尝试执行以下操作:

  1. 将您的Android Studio更新到最新版本(如果您使用的是3.0,Canary 4昨天刚刚推出)
  2. 我看到你正在使用带有Lolipop的仿真器(api 22),尝试使用api 25(Nougat)创建新设备
  3. 尝试在清单中做一些更改(比如添加空行,重点是更改清单文件),然后转到Build-> Clean项目并再次运行它。

暂无
暂无

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

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