ADB
Find the path where an application resides
The adb shell PM list package - f | grep filterCopy the code
Removing an Application Package
Adb shell rm Application pathCopy the code
Querying all packages
adb shell pm -l
Copy the code
Find the path of a package
Adb shell PM path Specifies the full application package nameCopy the code
Uninstall packages
Adb uninstall Complete application package nameCopy the code
Start the activity
Adb shell am start-n "adb shell am start-n"Copy the code
ADB Mandatory installation
[INSTALL_FAILED_TEST_ONLY: installPackageLI]
Adb install -t Full application package nameCopy the code
[INSTALL_FAILED_VERSION_DOWNGRADE]
Adb install -d Adb install -dCopy the code
-d: allow version code downgrade
ADB checks CPU usage
adb shell top -m 10 -s 8
Copy the code
-M 10 ranks the top 10
View the APK version
The adb shell dumpsys package package name | grep versionNameCopy the code
GIT
branch
Create a new branchfeature1
git branch feature1
Copy the code
The newbranch
It does not automatically switch, switch (new) branches
git checkout -b feature1
Copy the code
Updating remote branches
git remote update origin --prune
Copy the code
Delete the branch
Git branch -d Specifies the branch nameCopy the code
Deleting branch also deletes the reference, not any commit
A branch that has not been merged into the master will fail to be deleted. If you want to delete that branch, you can change -d to -d and lowercase to uppercase
stash
The Stash directive allows you to keep the contents of your working directory in a single place at your local location. It can never be committed or deleted. Once you put it away, you can do your temporary work. Files that have never been tracked (i.e., files that have been added) are no longer stash stash files
git stash
Copy the code
If you want to stash files that are not tracked, you can add the -u parameter
git stash -u
Copy the code
Print out all the current stash versions
git stash list
Copy the code
Retrieves the content stored under the specified version number
git stash apply stash@{1}
Copy the code
When all stacks are applied back, the stack can be emptied
git stash clear
Copy the code
reset
Fall back to a COMMIT
Git reset - - hard de0245cfCopy the code
The essence of the reset directive: Resets the HEAD and the branch it points to. Three parameters of reset:
git reset --hard HEAD^
Copy the code
–hard: Clears all changes to the working directory while resetting the location;
–soft: Resets the location while preserving the contents of the working directory and the staging area, and puts the new file differences caused by resetting the HEAD position into the staging area.
— Mixed (default) : Resets the location while retaining the contents of the working directory and clearing the staging area.
merge
After the merge conflict is resolved, there is no need to commit.
git merge --continue
Copy the code
Cancel this merge after conflict:
git merge --abort
Copy the code
If the HEAD and target commit still do not fork and are behind the target commit, this operation has a special name called “fast-forward”.
Add additional Fast Forward commit information
git merge feature1 --no--ff
Copy the code
pull
git pull = git fectch + git merge
Copy the code
log
View files changed during the most recent commit (-3 indicates the last three)
git log -3 --stat
Copy the code
Log -p Displays detailed history information
git log -p
Copy the code
-p stands for –patch
Take a look at the changes
git log --stat
Copy the code
View commit graphically
git log --graph
Copy the code
View the specific COMMIT
git show 5e68b0d8
Copy the code
Look at the specified file in Specify COMMIT
git show 5e68b0d8 a.txt
Copy the code
diff
Displays the difference between the staging area and the previous commit
If you type git commit, what will you commit
git diff --staged
Copy the code
Compare the working directory with the staging area
If you add all files now, what would you add to the staging area:
git diff
Copy the code
rebase
Instead of forking commit history, you can use rebase instead of merge.
Git rebase target base pointCopy the code
Rebase does not modify the base commit. Instead, it copies a new commit from the base and handles any conflicts within that commit
To modify a previous submission, you can use Rebase interactively
There are currently three submissions: (1) 6CDACb // last commit (2) 3988F81 (3) EF266B4 now wants to modify the content of (2) EF266B, such as the commit log information, or the specific code content rebase -I 4bfee6 to (3) Pick 3988f8... pick 6cdacb ... Because you need to modify the second EF266b, change pick to Edit ef266b4 and then you can modify the file. After that, git add, Then git commit -- Amend can modify the commit log and proceed to the (1) commit 6cdacb with the following command. Git rebase --continue if there is no next git rebase --continueCopy the code
Note: The commit will not be changed directly in the previous commit, the commit after rebase will be new
revert
If the error content has been merged into the master, rebase cannot be used. Otherwise, will the forced push erase the new submission just sent by the colleague? It is very easy to cause problems.
Use revert in this case:
Fill in which commit you want to undo
git revert HEAD^
Copy the code
This line of code adds a new commit whose contents are the opposite of the penultimate commit, cancelling the penultimate commit to undo it.
reflog
Reflog, short for “Reference Log,” allows you to view the movement records of references in your Git repository. Reflog views the HEAD movement history by default. You can manually add names to view the movement history of other references, such as a branch
git reflog master
Copy the code
cheery-pick
Cherry-pick is a special merge operation that allows you to select one or more Commits and merge them sequentially to the current branch.
git cherry-pick 6cdacb
Copy the code
Gradle
1. View the dependency tree relationship
/gradlew: module name :dependencies or just look at implementation./gradlew: module name :dependencies --configuration implementationCopy the code
The signature
apksigner
Apksigner command path sign --ks Signature APK pathCopy the code
ex:
/ Users/XXX/Library/Android/SDK/build - the tools / 29.0.3 apksigner sign - ks/Users/XXXX/Downloads/a.k eystore /Users/xxx/Downloads/a.apkCopy the code
other
“Too many files” error reported when compiling AS
sudo launchctl limit maxfiles 50000 200000
Copy the code