【问题标题】:Installed HelloWorld app on physical Android device through Eclipse. How do I find it on phone?通过 Eclipse 在物理 Android 设备上安装 HelloWorld 应用程序。我如何在手机上找到它?
【发布时间】:2014-03-10 16:51:28
【问题描述】:

Eclipse 中的控制台这样说:

[2014-03-10 17:46:08 - MyFirstApp] ------------------------------
[2014-03-10 17:46:08 - MyFirstApp] Android Launch!
[2014-03-10 17:46:08 - MyFirstApp] adb is running normally.
[2014-03-10 17:46:08 - MyFirstApp] No Launcher activity found!
[2014-03-10 17:46:08 - MyFirstApp] The launch will only sync the application package on the device!
[2014-03-10 17:46:08 - MyFirstApp] Performing sync
[2014-03-10 17:46:17 - MyFirstApp] Uploading MyFirstApp.apk onto device 'TA88307T9S'
[2014-03-10 17:46:17 - MyFirstApp] Installing MyFirstApp.apk...
[2014-03-10 17:46:19 - MyFirstApp] Success!
[2014-03-10 17:46:19 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-03-10 17:46:19 - MyFirstApp] Done!

这是在从在线导入 Hello World 应用程序之后。现在我希望在我的手机上找到一个应用程序图标来启动它,但我找不到它。如何启动应用程序?

在 Merlevede 的回答之后,我的清单 xml 文件现在看起来像这样:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

<intent-filter android:label="@string/app_name">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:debuggable="true"
    android:theme="@style/AppTheme" >

</application>

</manifest>

但问题仍然存在。

【问题讨论】:

    标签: eclipse adb smartphone android


    【解决方案1】:

    未找到启动器活动!

    正如日志所说,您没有启动器活动。要解决这个问题,请根据您的要求进行任何活动

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.myfirstapp"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="19" />
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:debuggable="true"
            android:theme="@style/AppTheme" >
    
            <activity
                android:name="com.example.myfirstapp.MainActivity"
                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>
    

    【讨论】:

      【解决方案2】:

      问题出在您的 Android Manifest xml 文件中。您的 Main Activity 缺少其中一些行(MAIN 操作或 LAUNCHER 类别)。

      <activity android:name="mx.company.app.ActivityMain" android:label="@string/title_activity_main" >
          <intent-filter android:label="@string/app_name">
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
      </activity>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-10-06
        • 1970-01-01
        • 1970-01-01
        • 2011-06-05
        相关资源
        最近更新 更多