The adb command

Install the apk

-f Indicates mandatory installation

adb install -f apk
Copy the code

Gets the current top activity name

Windows: adb shell dumpsys window | findstr searches mCurrentFocus MAC: adb shell dumpsys window | grep mCurrentFocusCopy the code

Apksigner command

View the APK signature mode command

apksigner verify -v apk
Copy the code

Sign the APK

  1. Versions greater than 28
apksigner sign --ks your_keystore_file --v1-signing-enabled 

true --v2-signing-enabled true --v3-signing-enabled false your_apk_file
Copy the code
  1. Version less than 28
apksigner sign --ks your_keystore_file --v1-signing-enabled 

true --v2-signing-enabled true your_apk_file
Copy the code

Apktool command

decompiling

apktool d apk
Copy the code

Are compiled

If output is not specified, the default APK is in the dist folder of the directory

Apktool b Decompilation directory nameCopy the code

other

Apk alignment command

zipalign -v 4Source APK Destination APKCopy the code