Posts in category “Tips”

A reliable/fast way to know an APK file's api level

I googled quite a while and found the following way is the best:

If you have Android Studio installed, using the "Build > Analyze APK" menu command is indeed a convenient way to quickly determine the supported API level of an APK file. Here are the steps:

Open Android Studio.

Go to "Build" in the top menu.

Choose "Analyse APK..."

Navigate to and select the APK file you want to analyze.

Android Studio will display information about the APK, including the minimum and target API levels.

Surely if you don't have Android Studio installed, then this way cannot help.

Clear nuget cache

cat ~/bin/clear-nuget-cache
nuget locals all -clear

Reference

Fix `Set-ItemProperty: Cannot find drive. A drive with the name 'IIS' does not exist.` issue

Background We still have quite a few projects that depends windows platform. I met Set-ItemProperty: Cannot find drive. A drive with the name 'IIS' does not exist. issue when I was running a powershell script, and I couldn't find an answer until I asked my colleague Matthew.

The ANSWER

Powershell 7 is supposed to support all platforms, so it removed those windows specific features.You should use Powershell for windows instead.

Yes, this solved the issue. Thanks!

git stash -S # stash staging changes only

git-stash-s.png

Don't change the inode when editing a file with Vim

I keep my config files on github, and I use hard-link for most of the config files. It's convenient, as I can check the new changes easily and submit some of the changes when necessary. However, the default behavior of vim troubles me. It always changed the inode when I save the config file!

tldr; the solution is: put the following line in your .vimrc

set backupcopy=yes

PS Though this way fixed Vim's behavior, I sadly found that git pull will change the config file's inode as well. So there is actually no feasible solution. I have abandoned this hard link approach. If you have better solutions to maintain all your config files in one repository, please let me know!