一、查找应用的主activity:
pm list packages 发现所有的包
dumpsys package + 包名: 获取所有的包信息,可以所有关键词MAIN来找主activity
也可以通过下面命令找到所有activity,看下面大概率com.android.settings/.Settings为主activity
dumpsys package com.android.settings | grep -i activity
2dee926 com.android.settings/.SettingsAdvancedConnectedDeviceActivity filter d570967 9a0114d com.android.settings/.SettingsAutomaticStorageManagerSettingsActivity filter cfb0402
37c7254 com.android.settings/.SettingsAppBubbleNotificationSettingsActivity filter 7ca75fd 47c7621 com.android.settings/.SettingsApnEditorActivity filter 3828a46
47c7621 com.android.settings/.SettingsApnEditorActivity filter 3828a46 c5ef02b com.android.settings/.SettingsPublicVolumeSettingsActivity filter ddb8c88
47c7621 com.android.settings/.Settings$ApnEditorActivity filter cda6407
二、例子8295:
#:/ # pm list packages | grep -i setting
package:com.android.providers.settings
package:com.android.settings
dumpsys package com.android.settings | grep -i activity Activity Resolver Table:
6124ef5 com.android.settings/.Settings$ApnEditorActivity filter 58748a
5071fdf com.android.settings/.Settings$PublicVolumeSettingsActivity filter 538b42c
6124ef5 com.android.settings/.Settings$ApnEditorActivity filter 5e7dafb
最后:
am start -n "com.android.settings/.Settings"
三、CloudCampus iperf华为测试工具,查找包名以及其主activity
dumpsys package com.huawei.acceptance | grep -i activity
am start -n com.huawei.acceptance/.PrivatePolicyMainActivity
am start -n com.nextdoordeveloper.miperf.miperf/.MainActivity
四、Wifi P2P的包和启动命令:
am start -n "github.leavesczy.wifip2p/.MainActivity"
am start -n "com.example.testsystem/.MainActivity"