查询包名、权限&adb增加权限&adb版本更新

1、用 aapt d permissions xxx.apk, 来查询包名和权限,aapt 在路径sdk\build-tools\21.1.2下

     aapt dump badging D:\test\xxx.apk获取包名、权限、launchable-activity.


2、java 执行:adb shell pm grant 包名 权限, 来赋予权限。

private static String storage = "adb shell pm grant com.android.chrome android.permission.WRITE_EXTERNAL_STORAGE";
private static String storage2 = "adb shell pm grant com.android.chrome android.permission.WRITE_MEDIA_STORAGE";
private static String storage3 = "adb shell pm grant com.android.chrome android.permission.MOUNT_UNMOUNT_FILESYSTEMS";
private static String storage4 = "adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE";
	
Runtime exec = Runtime.getRuntime();
exec.exec(storage);
exec.exec(storage2);
exec.exec(storage3);
exec.exec(storage4);

3、adb工具包最新Google官方版下载地址:

ADB和Fastboot for Windows

https://dl.google.com/android/repository/platform-tools-latest-windows.zip

ADB和Fastboot for Mac

https://dl.google.com/android/repository/platform-tools-latest-darwin.zip

ADB和Fastboot for Linux

https://dl.google.com/android/repository/platform-tools-latest-linux.zip

这些 Google 链接,用户可以确保下载不仅是官方的,而且将始终能够获得最新版本的 ADB 和 Fastboot

替换sdk\platform-tools\adb.exe即可。

4、appium h5测试调用的chromedriver路径

Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值