[TOOL] ADB 주요 명령

Programming/Android 2015. 3. 15. 23:24 posted by B&U

1. 기본 Manifest File

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="PackageName"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="19" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        >
        <activity
            android:theme="@style/Theme.AppCompat.Light"
            android:uiOptions="splitActionBarWhenNarrow"
            android:name="ActivityName"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="ACTION_NAME" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>            
    </application>

</manifest>

 

2. APK 설치

   adb -d install -r app-debug.apk

   - -d 옵션 : attached device 사용한다.

   - -r 옵션 : APK 재설치

 

3. Activity 실행  

   adb shell am start -a ActionName -n PackageName/ActivityName