利用 adb shell am start 執行裝置上的應用程式懶人包 v1
 
範例
adb shell am start -n org.codeaurora.snapcam/com.android.camera.CameraLauncher
 
指令
 
adb shell am start -n [PACKAGE-NAME]/[ACTIVITY-NAME]
 
PACKAGE-NAME 參數
利用指令
adb shell pm list packages -f > package.txt
edit and search package.txt
found "package:/system/priv-app/SnapdragonCamera/SnapdragonCamera.apk=org.codeaurora.snapcam"
so the package name is org.codeaurora.snapcam
 
 
ACTIVITY-NAME 參數
利用指令
adb shell dumpsys activity > activity.txt
edit and search "org.codeaurora.snapcam" inactivity.txt
--
..
packageName=org.codeaurora.snapcam processName=org.codeaurora.snapcam
    launchedFromUid=10015 launchedFromPackage=com.android.launcher3 userId=0
    app=ProcessRecord{14c9730 3549:org.codeaurora.snapcam/u0a25}
    Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=org.codeaurora.snapcam cmp=org.codeaurora.snapcam/com.android.camera.CameraLauncher bnds=[365,659][448,779] }
    frontOfTask=true task=TaskRecord{d1d92e5 #36 A=com.android.camera.CameraActivity U=0 StackId=1 sz=1}
    taskAffinity=com.android.camera.CameraActivity
    realActivity=org.codeaurora.snapcam/com.android.camera.CameraActivity
    baseDir=/system/priv-app/SnapdragonCamera/SnapdragonCamera.apk
    dataDir=/data/user/0/org.codeaurora.snapcam
    stateNotNeeded=false componentSpecified=true mActivityType=0
    compat={240dpi always-compat} la
..
--
so the ACTIVITY-NAME is com.android.camera.CameraLauncher.
 
Then full am start command is 
 
adb shell am start -n org.codeaurora.snapcam/com.android.camera.CameraLauncher
 

method 2
check application O:\oreo-master-aosp\packages\apps\SnapdragonCamera\AndroidManifest.xml
--
    package="org.codeaurora.snapcam">
 
       <activity-alias
            android:name="com.android.camera.CameraLauncher"
            android:icon="@mipmap/ic_launcher_camera"
            android:label="@string/snapcam_app_name"
            android:launchMode="singleTop"
            android:targetActivity="com.android.camera.CameraActivity">
            <intent-filter>
 
--
 
 
 
 

文章標籤

CuteParrot 發表在 痞客邦 留言(0) 人氣()