使用adb命令管理应用

第一步:上传应用
adb push push
第二步:安装应用
adb shell pm install -t -r install
第三步:查看包名
adb shell pm list package -f使用adb命令管理应用_第1张图片
第四步:查看启动Activity类名
4-1:adb shell
4-2: dumpsys package <应用包名>
4-3:找到Category为Launcher的Activity使用adb命令管理应用_第2张图片

使用adb命令管理应用_第3张图片

第五步:启动应用
adb shell am start -n <应用包名>/<应用启动Activity绝对名称>在这里插入图片描述
第六步:卸载应用
adb uninstall <应用包名>

PS:工作中可能会遇到卸载system下的应用,如果使用上面的命令就行不通了,可以尝试一下下面的命令:adb shell pm uninstall --user 0 <应用包名>

卸载
adb uninstall 包名
adb卸载系统应用
//卸载:
adb shell pm uninstall --user 0 应用包名 

停用:
adb shell pm disable-user 应用包名 

启用:
adb shell pm enable 应用包名
adb停止应用进程:
adb shell am force-stop 应用包名

adb获取root权限:
adb root

adb重新挂载:
adb remount

adb查看系统版本:
adb shell getprop ro.build.version.release

adb查看内存使用:
adb shell 
cat /proc/meminfo
修改IP地址
adb shell ifconfig eth0 192.168.4.223 netmask 255.255.255.0

查看IP地址

adb shell netcfg

如何查看android设备属于什么架构的?

第一步:输入 adb shell 回车
第二步:cat /proc/cpuinfo 回车

adb命令打开手机设置页面:

设置主页面

adb shell am start com.android.settings/com.android.settings.Settings

安全

adb shell am start com.android.settings/com.android.settings.SecuritySettings

手机无线信息

adb shell am start com.android.settings/com.android.settings.RadioInfo

更多页面

com.android.settings.AccessibilitySettings 辅助功能设置
com.android.settings.ActivityPicker 选择活动
com.android.settings.ApnSettings APN设置
com.android.settings.ApplicationSettings 应用程序设置
com.android.settings.BandMode 设置GSM/UMTS波段
com.android.settings.BatteryInfo 电池信息
com.android.settings.DateTimeSettings 日期和坝上旅游网时间设置

adb拉取tombstones文件

adb pull /data/tombstones D:\

adb拉取anr文件

adb pull /data/anr/traces.txt

你可能感兴趣的:(Android基础,android,adb)