Android’s commonly used but less popular command lines

1. Obtain the sha1 value of the apk signature

This value is often used when accessing the sdk. It can be obtained by entering the following command through the Terminal of Android studio.

 1. keytool -v -list -keystore 【keystore文件路径】
 2. 输入Keystore的密码

2. Update the project Git push address

1. 获取当前仓库地址 git remote get-url origin
2. 设置当前仓库地址 git remote set-url origin [url]

3. Steps for git tagging

For more details, click here to view

1. Create tag:

git tag [标签名] -m [tag内容描述]

2. View tag:

git tag //所有tag 
git tag -l [*tag名*] //[]中两侧的*表示在整个tag名里模糊匹配,所以此处可以不用输入完整名称
git tag --list [*tag名*] //同“-l”的作用 

3. Push the tag to the warehouse

git push origin [tag名] //将指定标签推送到仓库 这里的tag名需要完整输入
git push origin --tags //将所有不在仓库的tag一起推送到仓库中

4. Delete tag

a. Local tag deletion

git tag -d [tag名] //完整tag名称

b. Delete warehouse tag

git push origin --delete [tag名] //完整的tag名

5. Switch branch development based on tags

git checkout -b [分支名] [tag名]

4. Adb command to obtain device CPU model

1. The highest supported cpu abi type

adb shell getprop ro.product.cpu.abi

2. Get all supported abi types

adb shell getprop ro.product.cpu.abilist

Extension: Get the highest supported cpu abi of the current device through code

if (Build.SUPPORTED_64_BIT_ABIS.isNullOrEmpty()) "支持32位" else "支持64位"

5. Obtain apk information

1. Obtain the installation package information according to aapt, including package name, version name/number, application permission, startup page name, etc.

首先切换到sdk的build-tools中某一版本的aapt所在文件夹 cd [aapt.exe所在的文件夹路径]
然后输入以下命令获取信息
aapt dump badging [apk文件的完整路径]

Get the result as shown in the figure:
Insert image description here

2. Obtain according to adb command

adb shell "dumpsys package [包名] | grep [查询内容]"

//[包名]即要查询apk的包名, 这个值也可以是系统android
//[查询内容] 例:versionName、versionCode、permission等

For example:
Insert image description here

Guess you like

Origin blog.csdn.net/qq_39734865/article/details/132689334