在 macOS 26 系统中,Apple 增强了「聚焦搜索」(Spotlight)的功能。如果你启用了 iPhone 镜像,系统会自动将 iPhone 上的应用程序同步到 Mac 的聚焦搜索结果中,方便直接在 Mac 上快速启动或查找。
如下图:
Mac是苹果自1984年起以“Macintosh”开始的个人消费型计算机,如:iMac、Mac mini、Macbook air、Macbook pro、Mac pro等计算机。使用独立的Mac os系统,最新的OS X系列基于NeXT系统开发,不支持兼容。是一套完备而独立的生态系统。
在 macOS 26 系统中,Apple 增强了「聚焦搜索」(Spotlight)的功能。如果你启用了 iPhone 镜像,系统会自动将 iPhone 上的应用程序同步到 Mac 的聚焦搜索结果中,方便直接在 Mac 上快速启动或查找。
如下图:
解除50M文件限制,Windows访问服务时,大于50M文件提示错误[错误:0x800700DF]
以目前的情况来看,Flutter 的桌面端软件其实跟移动端软件很像,因为 Flutter 桌面端目前默认只有一个窗口,而不是像原生的桌面端软件一样,经常会有很多个窗口。 比较不一样的是,移动端是直接全屏显示,桌面端的软件是以窗口的形式存在的。
而桌面端窗口大小可以设置,还可以由用户自由放大缩小。
所以一般桌面端软件都需要对窗口做一些配置,比如设置启动时的默认窗口大小以达到最佳的界面显示,设置最小的窗口大小来避免界面变形严重或者遮盖了重要界面等等。
我们希望应用启动后就占据整个屏幕,但是不是最大化,顶部状态栏,底部不要进行覆盖,类似 Chrome 浏览器的行为。
可以使用 window_manager 插件来实现,但是发现达不到想要的效果。
后面发现 learnFlutter 还有一个开源库是 screen_retriever ,这个插件允许 Flutter 桌面 应用检索关于屏幕大小,显示,光标位置等信息。
试了下确实可以获取到屏幕的高度,可行的实现方式是使用 screen_retriever 获取到屏幕的高度之后再使用window_manager 设置窗口大小。
但是,上述的代码由于需要 Flutter 引擎初始化之后才能执行,因此会短暂先出现小窗口,然后窗口才会变大。整个过程中有明显的延迟,用户体验不好。
因此,还是需要从底层API层面进行窗口大小的调整,应用启动后,窗口大小立即调整完成,用户体验较好。
方案一:
通过调用 NSWindow 的 zoom 函数,实现窗口的放大。代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import Cocoa import FlutterMacOS @main class AppDelegate: FlutterAppDelegate { override func applicationDidFinishLaunching(_ notification: Notification) { mainFlutterWindow?.zoom(nil) } override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { return true } } |
方案二:
通过调整 NSWindow 的 visibleFrame ,实现窗口的放大。代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import Cocoa import FlutterMacOS @main class AppDelegate: FlutterAppDelegate { override func applicationDidFinishLaunching(_ notification: Notification) { // Get the main screen's visible frame if let screenFrame = NSScreen.main?.visibleFrame { // Set the window's frame to match the screen's visible frame mainFlutterWindow?.setFrame(screenFrame, display: true) } } override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { return true } } |
方案三(推荐):
调整 MainFlutterWindow 的代码,直接设置窗口大小:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import Cocoa import FlutterMacOS class MainFlutterWindow: NSWindow { override func awakeFromNib() { let flutterViewController = FlutterViewController.init() // let windowFrame = self.frame self.contentViewController = flutterViewController // self.setFrame(windowFrame, display: true) // 设置窗口启动后铺满整个屏幕 // Get the main screen's visible frame if let screenFrame = NSScreen.main?.visibleFrame { // Set the window's frame to match the screen's visible frame self.setFrame(screenFrame, display: true) } else { let windowFrame = self.frame self.setFrame(windowFrame, display: true) } RegisterGeneratedPlugins(registry: flutterViewController) super.awakeFromNib() } } |
Windows 系统下的解决方案比较简单,直接修改 ShowWindow 函数的参数,设置为 SW_MAXIMIZE 即可。代码如下:
1 2 3 4 5 6 7 |
..................................................... bool Win32Window::Show() { return ShowWindow(window_handle_, /*SW_SHOWNORMAL*/ SW_MAXIMIZE); } ..................................................... |
Linux 系统下的使用的是 GTK,因此可以通过在初始化窗口之前调用 gtk_window_maximize 函数即可(此函数支持窗口显示之前调用)。代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// Implements GApplication::activate. static void my_application_activate(GApplication *application) { ................................................................ const int64_t window_width = 1280; const int64_t window_height = 720; gtk_window_set_default_size(window, window_width, window_height); // 设置窗口最大化 gtk_window_maximize(window); gtk_widget_show(GTK_WIDGET(window)); ................................................................ } |
cronet demo 使用的 ninja 打包,查找 Provisioning Profiles 路径是 ~/Library/MobileDevice/Provisioning Profiles,但 Xcode 16 把该路径改为了 ~/Library/Developer/Xcode/UserData/Provisioning Profiles,导致在编译 cronet 的 demo 时找不到证书。
解决办法是把 Xcode 16 的路径下的证书拷贝一份到老的路径 ~/Library/MobileDevice/Provisioning Profiles 即可。
Mac 应用有多种证书,主要包含以下几种:
从 FreeCAD 下载每周构建版本,则在安装后会报错“已损坏,无法打开。 您应该将它移到废纸篓”,类似下图:
输入法切换到 “简体拼音”, 然后按下自带键盘上的 左侧 Shift 与 - 按键,目的是按出下划线,会导致 OpenSCAD 闪退,崩溃堆栈如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: OpenSCAD [87606] Path: /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD Identifier: org.openscad.OpenSCAD Version: 2024.12 (2024.12.30) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2025-01-07 10:43:50.0163 +0800 OS Version: macOS 15.2 (24C101) Report Version: 12 Anonymous UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Sleep/Wake UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Time Awake Since Boot: 1700000 seconds Time Since Wake: 5033 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: OpenSCAD [87606] Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18fec7720 __pthread_kill + 8 1 libsystem_pthread.dylib 0x18fefff70 pthread_kill + 288 2 libsystem_c.dylib 0x18fe0c908 abort + 128 3 libc++abi.dylib 0x18feb644c abort_message + 132 4 libc++abi.dylib 0x18fea4a24 demangling_terminate_handler() + 320 5 libobjc.A.dylib 0x18fb4d3f4 _objc_terminate() + 172 6 libc++abi.dylib 0x18feb5710 std::__terminate(void (*)()) + 16 7 libc++abi.dylib 0x18feb8cdc __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88 8 libc++abi.dylib 0x18feb8c84 __cxa_throw + 92 9 libqscintilla2_qt6.15.dylib 0x1025f20f8 0x10245c000 + 1663224 10 libqscintilla2_qt6.15.dylib 0x1025bb4e8 0x10245c000 + 1438952 11 libqscintilla2_qt6.15.dylib 0x1025ed018 0x10245c000 + 1642520 12 libqscintilla2_qt6.15.dylib 0x10246f358 QsciScintillaBase::keyPressEvent(QKeyEvent*) + 448 13 QtWidgets 0x1039d17d8 QWidget::event(QEvent*) + 556 14 QtWidgets 0x103a4f780 QFrame::event(QEvent*) + 56 15 QtWidgets 0x103988c58 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272 16 QtWidgets 0x103989cec QApplication::notify(QObject*, QEvent*) + 972 17 OpenSCAD 0x100a85440 OpenSCADApp::notify(QObject*, QEvent*) + 28 18 QtCore 0x104dd124c QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292 19 QtWidgets 0x1039e43a0 QWidgetWindow::event(QEvent*) + 168 20 QtWidgets 0x103988c58 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272 21 QtWidgets 0x103989af8 QApplication::notify(QObject*, QEvent*) + 472 22 OpenSCAD 0x100a85440 OpenSCADApp::notify(QObject*, QEvent*) + 28 23 QtCore 0x104dd124c QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292 24 QtGui 0x102e1b110 QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) + 260 25 QtGui 0x102e70c24 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 396 26 QtGui 0x102e70810 QWindowSystemInterface::flushWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 284 27 libqcocoa.dylib 0x1038446d4 -[QNSView(Keys) handleKeyEvent:] + 1760 28 libqcocoa.dylib 0x10384540c -[QNSView(Keys) keyDown:] + 76 29 AppKit 0x193c77e5c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 316 30 AppKit 0x193c77b50 -[NSWindow(NSEventRouting) sendEvent:] + 284 31 libqcocoa.dylib 0x10384d16c -[QNSWindow sendEvent:] + 824 32 AppKit 0x1944b4378 -[NSApplication(NSEventRouting) sendEvent:] + 2360 33 libqcocoa.dylib 0x1037f2330 -[QNSApplication sendEvent:] + 68 34 AppKit 0x1940bb4e8 -[NSApplication _handleEvent:] + 60 35 AppKit 0x193b44088 -[NSApplication run] + 520 36 libqcocoa.dylib 0x1037fde9c QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1904 37 QtCore 0x104ddabc4 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 532 38 QtCore 0x104dd18d8 QCoreApplication::exec() + 112 39 OpenSCAD 0x100a34c9c gui(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, std::__1::__fs::filesystem::path const&, int, char**) + 2076 40 OpenSCAD 0x100716b10 main + 18796 41 dyld 0x18fb80274 start + 2840 |
使用 VNC Viewer 的时候可能会遇到记住密码功能失效的问题,每次登录都需要重新输入密码,该怎么解决呢?
这个问题发生的原因是由于系统升级/新旧电脑数据迁移之后, VNC Viewer 存储在本地的密码密钥丢失。没办法在进行加解密,而以前残存的损坏的密码文件,又恰好阻挡了新密码的写入。
这个问题在 macOS 系统上更加严重,密钥是不允许跨设备传输的,导致迁移的时候,加密文件能迁移成功,但是数据解密不出来。
最简单的办法就是直接删除之前的密码存储文件,对于 macOS 来说,可以执行:
1 |
$ rm ~/.vnc/config.d/vncviewer.d/passwords.json |
对于 Windows 来说
1 |
C:\Users\<user>\AppData\Local\RealVNC\vncviewer.d |
当然也可以参考官网提供的解决方法:
1 2 3 |
In VNC Viewer > Preferences > Privacy please tick 'Protect VNC Viewer with a master password', set a password and then click Apply, OK. Once you have done this, re-open your Preferences and untick 'Protect VNC Viewer with a master password' and retry your connection. |
两者的方案原理是一致的,都是强制重建已经存在的密码存储文件。
翻译过来就是:
在 VNC 查看器 > 首选项 > 隐私中,请勾选“使用主密码保护 VNC 查看器”,设置密码,然后单击应用,确定。
完成此操作后,重新打开首选项并取消选中“使用主密码保护 VNC 查看器”并重试连接。
源代码编译 sqlite3 :
1 2 3 4 5 6 7 8 9 10 |
# https://github.com/clemensg/sqlite3pod $ wget https://www.sqlite.org/2024/sqlite-src-3450100.zip $ unzip sqlite-src-3450100.zip $ cd sqlite-src-3450100 $ ./configure $ make |
或者使用 pod 安装 sqlite3 报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
$ pod try sqlite3 Updating spec repositories Trying sqlite3 [!] /opt/homebrew/bin/bash -c set -e cd sqlite-src-3450100 ./configure make sqlite3.c sqlite3.h sqlite3ext.h checking build system type... arm-apple-darwin23.4.0 checking host system type... arm-apple-darwin23.4.0 checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /opt/homebrew/bin/gsed checking for grep that handles long lines and -e... /opt/homebrew/bin/ggrep checking for egrep... /opt/homebrew/bin/ggrep -E checking for fgrep... /opt/homebrew/bin/ggrep -F checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 786432 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for dsymutil... dsymutil checking for nmedit... nmedit checking for lipo... lipo checking for otool... otool checking for otool64... no checking for -single_module linker flag... no checking for -exported_symbols_list linker flag... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin23.4.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking for int8_t... yes checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for intptr_t... yes checking for uint8_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uintptr_t... yes checking for sys/types.h... (cached) yes checking for stdlib.h... (cached) yes checking for stdint.h... (cached) yes checking for inttypes.h... (cached) yes checking malloc.h usability... no checking malloc.h presence... no checking for malloc.h... no checking for fdatasync... yes checking for gmtime_r... yes checking for isnan... yes checking for localtime_r... yes checking for localtime_s... no checking for malloc_usable_size... no checking for strchrnul... no checking for usleep... yes checking for utime... yes checking for pread... yes checking for pread64... no checking for pwrite... yes checking for pwrite64... no checking for tclsh8.7... no checking for tclsh8.6... tclsh8.6 configure: Version set to 3.45 configure: Release set to 3.45.1 checking for WASI SDK directory... no checking whether to support threadsafe operation... yes checking for library containing pthread_create... none required checking for library containing pthread_mutexattr_init... none required checking whether to support shared library linked as release mode or not... no checking whether to use an in-ram database for temporary tables... no checking if executables have the .exe suffix... unknown checking for Tcl configuration... found /opt/homebrew/Cellar/tcl-tk/8.6.14/lib/tclConfig.sh checking for existence of /opt/homebrew/Cellar/tcl-tk/8.6.14/lib/tclConfig.sh... loading checking for library containing readline... -ledit not using linenoise checking for library containing fdatasync... none required checking build type... release checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for library containing deflate... -lz checking for library containing dlopen... none required checking whether to support math functions... yes checking for library containing ceil... none required checking whether to support JSON functions... yes checking whether to support MEMSYS5... no checking whether to support MEMSYS3... no checking whether to support FTS3... no checking whether to support FTS4... no checking whether to support FTS5... no checking whether to support LIMIT on UPDATE and DELETE statements... no checking whether to support GEOPOLY... no checking whether to support RTREE... no checking whether to support SESSION... no configure: creating ./config.status config.status: creating Makefile config.status: creating sqlite3.pc config.status: creating sqlite_cfg.h config.status: sqlite_cfg.h is unchanged config.status: executing libtool commands gcc -g -O2 -o mkkeywordhash -DSQLITE_ENABLE_MATH_FUNCTIONS /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/mkkeywordhash.c ./mkkeywordhash >keywordhash.h gcc -g -O2 -o lemon /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/lemon.c cp /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/lempar.c . cp /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/src/parse.y . ./lemon -DSQLITE_ENABLE_MATH_FUNCTIONS -S parse.y sh /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/cktclsh.sh 8.4 tclsh8.6 touch has_tclsh84 cat parse.h /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/src/vdbe.c | tclsh8.6 /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/mkopcodeh.tcl >opcodes.h tclsh8.6 /private/var/folders/z8/_cvsdvbd4x51vm4szw5xkw0w0000gn/T/CocoaPods/Try/sqlite3/sqlite-src-3450100/tool/mkopcodec.tcl opcodes.h >opcodes.c make: *** No rule to make target `sqlite_cfg.h', needed by `.target_source'. Stop. |
观察源代码目录,也确实没有 sqlite_cfg.h 文件生成。
继续阅读make: *** No rule to make target `sqlite_cfg.h', needed by `.target_source'
使用 flutter、Android Studio ,通过iOS模拟器运行项目,一直一切正常。
某次重启后无法启动模拟器,报错信息如下:
1 |
"Unable to boot the simulator". |
解决方法,亲测有效:
macOS 14.4.1以及更高版本:
进入 “系统设置”→“通用”→“存储空间”→“开发者” 删除 “XCode 缓存” 。
在 macOS 13 及更高版本上:
进入 “系统设置”→“常规”→“存储”→“开发人员”
删除“开发者缓存”
在 macOS 12 及更低版本上:
转到“关于本机”→“存储”→“管理”→“开发人员”