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-6907dd528708999233[……]

Click link to continue reading...

Quickly update Python packages

Python is a good thing,Many times we like to use it to write small things... For example, many services on my server are written in Python ( Supervisor will use your Python program becomes Services ),Accumulate,Many dependency packages are actually used。

but,These Python dependencies will not follow your apt upgrade Update,Today, after a long time,I found a package I am using[……]

Click link to continue reading...

Cocoa Binding practical tutorial

First of all, this is not a new technology,It's very old,So old that almost no one mentions it。

This is a product of Apple's MVC model,It was born when there was no iPhone,It is used in conjunction with the Xcode graphical setting interface-such as NIB,of course,Now it has become XIB,Oh,And storyboard。

Now if you want to bind a storyboard object to the code,All you may find are like this:

Click the right mouse button in the left column to open a small window[……]

Click link to continue reading...

Xcode plugin is missing and does not display the solution

In system preferences,Xcode extensions are not displayed

In a previous article, I introduced a way to install multiple versions at the same time Xcode Tool ofUse xcode-install to manage Xcode versionsBut when there are multiple Xcodes in your system at the same time,Will cause system confusion,Make Xcode plugins unrecognizable,The main manifestation is that it is not visible at all in the system preferences Xcode pluginOptions-as if you haven't installed them at all。

In short,I'm hereHereFound the answer

First execute the command:
[crayo[……]

Click link to continue reading...

Use a third-party mouse without a driver on macOS

Enable management of Logitech mouse

All to known,macOS to third partiesmouseVery picky,If it is an ordinary office mouse,That almost works,At most, the fixed DPI requires adjusting the mouse speed.,But if it goes up to a gaming mouse with more buttons,There are many problems。

Not necessarily for playing games,For example, a mouse with forward and back buttons is very useful when writing code。

In General,The mouse of the famous manufacturer will support macOS better,Mainly because the big factory has the energy to make a mouse for macOSdrive,If a mouse is natively driven by Windows only,[……]

Click link to continue reading...

Use xcodebuild to archive and export app

I wrote an article beforemacOS app script to automate notarize,But there is no mention of using code to automatically compile and generate App scripts,After all, there are many tools to complete this step,For example, fastlane。

I didn’t think about automation before notarize,At the time of writing that article, fastlane did not support notarized upload,So I wrote it myself,The specific compilation command is like this:
[crayon-6907dd528[……]

Click link to continue reading...

/usr/libexec/lsd occupied 100% CPU solution

Suddenly discovered a large number of writes on the disk recently,Open the task manager,Found a process called "lsd" continues to occupy 20% – 40% CPU,Very strange。

After some inquiries,Learned that this process is a system process on macOS and iOS,Full name is "Launch Service Daemon",Responsible for all App file type association and startup。But its database is sometimes damaged,This causes it to frequently read and verify certain data。

Once its database is damaged,You will encounter lsd[……]

Click link to continue reading...

Use xcode-install to manage Xcode versions

we all know,There is pyenv when using Python,If you use ruby, there is rbenv,Can easily control and manage the version of the programming language environment,Then,Is there any way,Can Xcode switch versions like this?

Every time Xcode releases an update,More or not has become a problem,Difficult to download,Can't resume,Can't use third-party tools to download,It's really terrible... not to mention the compatibility issue when multiple versions。

use xcode-install,One time[……]

Click link to continue reading...

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9

Normal,You will encounter this error when installing a Python package,This package must be a package containing C ++ code。

This is due to incompatibility after macOS update,In General,The maintainer of this package should already be compatible with this particular situation:

So that it can be successfully compiled on macOS。

But if you are using PyPy,Maybe even if the maintainer includes this sentence,You can't succeed[……]

Click link to continue reading...

Python detects its own memory footprint in real time

Recently doing text statistics,Implemented in Python,Encountered an interesting problem-how to save statistical results。

Writing directly into memory is really impossible,Memory exhausted after ten hours,The program was forced to close。If you write directly to the database,Each write is too slow,It's been more than ten hours,If you go on like this, you will have to count on the week,Not a solution。

At last,I thought of a solution that combines both-using memory as a buffer,After reaching a certain amount, all the current data will be merged into the hard disk at one time。

But then there is a threshold,How to confirm[……]

Click link to continue reading...

Safari 13 Remove Google search results jump

Create a new Safari plugin project using Xcode

In Safari 9 before,We just download a safariextz file and double click on it,So that Safari can load this plugin。The benefit is definitely very convenient,But it ’s also not very secure (plugins that can be downloaded everywhere,It is likely to have been tampered with)。

So later,Apple no longer allows users to directly download plug-ins to install on Safari,App must be downloaded from Mac Apple Store,Then the Safari plugin is provided in the form of a plugin in the app,With App[……]

Click link to continue reading...

Avoid WordPress being used as a reflection amplification attack

Before I wrote an article,Use fail2ban Bind9 be used to prevent DNS amplification attacks,Never imagined,original Wordpress It can also be used for amplification attacks,The principle is its Pingback mechanism。

Pingback is a tool for notifying each other of a Wordpress website,For example, A blog refers to a link to a B blog post,Then Wordpress can automatically help you inform B blog,Tell the blogger that you quoted his article。

This[……]

Click link to continue reading...

iOS correctly set the status bar style color

When developing iOS apps,Many applications need to set the color of the iOS system status bar according to the current App content color,Black or white-especially on iOS 13 After the system supports the black mode。

Normal,Others will tell you to do this:

But this triggers a warning: Deprecated in iOS 9 。So is there any other way? Have,The official recommendation is[……]

Click link to continue reading...

How to get your macOS to display the Taiwan Flag Emoji again 🇹🇼️🇹🇼️🇹🇼️

macOS uses a dedicated field to store country codes

The Taiwan flag cannot be displayed at the earliest,It's on iPhone,Apple determines by iOS system region and language settings,if it is chinese,I will put the Taiwan flag emoticon displayed as :The cracking method is also very easy,Just change the language and region.,For example, select the language as Traditional Chinese or English。

Now,Apple no longer simply makes judgments based on language and other settings.,Determined by the iPhone hardware serial number - it cannot be modified。

This blocked garbled symbol is annoying to watch,How to remove it?

mac[……]

Click link to continue reading...

When Mailgun no longer free,How do you placed your domain mail?

Before I wrote an article:《 Use Mailgun create your free domain mailMailgun There is a very interesting feature is the recipient routing,With this feature set,You can use any incoming mail forwarding to your mailbox which set a good,This eliminates the need for each domain name to set up a mail service,Only through Mailgun On the corresponding e-mail can be forwarded by e-mail needs - after all,,Usually we will use these domain mail may be a basic authentication。

Recently,Mailgun no longer free,Free users[……]

Click link to continue reading...

Swift Python Json data exchange signature

It has been a very popular self-signed certificate for HTTPS decryption,Then there are a lot of people realize crack of App by modifying Apple's internal purchase receipt。In fact Verified Purchase should be connected to the server App,Server to communicate with Apple's servers,The results are then sent to the App - but a lot of developers (including individual developers and corporate developers) do not bother to go to a special server maintenance,So communicate directly with the App and Apple's servers,This provides an opportunity for middle attacks。

Middle attack,It means when A and B communicate[……]

Click link to continue reading...

Swift Debug EXC_BAD_ACCESS in AppDelegate

 

Many people will encounter in the development EXC_BAD_ACCESS ,I'm sorry,This time, Xcode does not give any detailed solutions。

usually,This is due to a memory error caused。In simple terms it is that you create an object A,But in the later time of the visit,A memory in this area have been moved to do the system he used,Put objects such as B here - A your left hand,The actual content does not exist。

Then there will be such a collapse similar:
[crayon-690[……]

Click link to continue reading...

Swift strftime use quick format date and time

Processing time and date software development is a very common operation,Almost all programming languages ​​provide a corresponding API to facilitate the development of the date and time to process,Swift is no exception,such as DateFormatter ,You can use it any Date Custom format is converted into a text string。

--but,[crayon-6907dd528a047150[……]

Click link to continue reading...