Three operating modes of macOS application

Normal,You won't encounter this problem,Until you need to write a background program...

We all know that macOS has a global Dock,All running programs will be displayed on this thing,But if your program is a menu bar applet,Or a...input method,Then you definitely don’t want the icon of this app to be displayed on the Dock,Because this kind of app needs to run continuously in the background。

At this time we can write in Info.plist [crayon-662ba2644c1df05[……]

Click link to continue reading...

After upgrading macOS Monterey, the device wakes up frequently in the middle of the night after sleeping

Recently updated to macOS Monterey, Waking up by the screen in the middle of the nightclub,It feels weird,Have been before,But the screen will only light up when there is a notification,Now I light it up without any reason,The hardware is still that hardware,Then it should be the software's pot。

Checked it online,First I found Apple's official tutorial:https://support.apple.com/zh-cn/guide/mac-help/mchlp2995/mac

Very detailed,But obviously there is no[……]

Click link to continue reading...

Gem install can't find binary after updating Ruby

I always use rbenv,Until this time after updating cocoapods,Execution error,of course,Visual inspection should be caused by my ruby ​​environment being too old,So I tried rbenv install 3.0.2 ,But unfortunately,Reported an error,Go to the official warehouse of rbenv to take a look,The last version is still 2019...Okay,Give it up,After deleting all the versions,I found that I have been using brew to install the latest version of ruby,Just use it directly。[……]

Click link to continue reading...

Avoid website hijacking by malicious domain names

The server of R0uter's blog rejected the embedding of the site

I accidentally found a batch of websites today,Such as http://b6x.net/ Now when you click on this website, it will display "www.logcg.com refused to connect.”,When I clicked on it for the first time, I was stunned...he actually copied my entire website? !

This is a series of three-digit domain name websites,Are similar operations。

and many more,I found something wrong,First of all, there is a white box on the outside of this website that my blog does not have... that is,This may be an anti-generation (reverse proxy)。

If you still[……]

Click link to continue reading...

zsh enable bash * Asterisk wildcard function

Recently I found that the server is very slow every time apt upgrade,The reason,There are still a lot of unused kernels that have to be regenerated every time,Encountered a problem while cleaning up,*Number matching does not take effect,You must manually enter the full kernel name each time to uninstall it。

Found after stepping on the pit,It turned out to be because I used zsh,and zsh The default is not supported * No. wildcard! It’s easy to turn on this feature,Find your zsh configuration file we ~/.zshrc [……]

Click link to continue reading...

Open Xcode Live Preview for UIKit

One of the big benefits of using SwiftUI is that you can hot update the App like Flutter,UI code changed,Will be directly reflected in the simulator or the real machine,Greatly improve the efficiency of writing user interfaces,No need to change 1px,run,Various clicks,Then check the loop of effects。But it's too early to use SwiftUI,After all, there is still a lot of iOS 12 Equipment is running,Want to do popular software,That still needs to be supported。

Then,Is there any way to make UIKit The software written can also be used in real-time[……]

Click link to continue reading...

Run and train Moses on macOS

Moses official website actually has macOS Binary packageof,You don't need to compile them from source。But short,Since Moses developers no longer use Macs,So he can't update,This leads to a bug in the code of the latest version (4.0),Make the binary file can not be used directly,The author said, "It's not difficult to compile from source anyway..." But in short,It is almost impossible to compile Moses from BigSur,Various strange errors,Headache。

In fact,We can directly modify the binary file[……]

Click link to continue reading...

Use Packages to create a pkg installation package that supports Apple M1 chip

Use advanced settings to modify Packages default parameters

It's been a while since Apple released the M1 chip device,Although I applied for DTK equipment at the first time,But for some reasons,Until Apple Recycles Equipment,I couldn't touch it myself。In short,The drop grid input method macOS still successfully supports the Apple architecture by blind typing,I.e. arm64,According to user feedback,The effect is ok。

Until some users say that although the app supports the m1 chip,But the installation package does not work-when running the pkg installation package,Rosetta 2 pops up...

Although it does not affect[……]

Click link to continue reading...

macOS uses the atos command to parse arbitrary crash records and sample data

Recently, the drop grid input method has encountered several difficult to reproduce problems-the key is that it will not cause a crash。This makes the crash statistics function completely ineffective,The specific performance is that the input method will suddenly get stuck for a few seconds in some cases,Very annoying。Then I thought,macOS comes with activity manager,There is a "sampling" function,You can see the current execution (call) status of the corresponding process,Can I use it to analyze the cause of the error?

After communicating with users,I got a sampling report like this:
[crayon-662ba2644e49a44825[……]

Click link to continue reading...