sh macOS锁屏1行命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh macOS锁屏1行命令相关的知识,希望对你有一定的参考价值。

# Do our work in the temporary directory that gets cleaned on boot
cd /tmp

# Create the source file
cat > main.m <<END_OF_FILE

#import <objc/runtime.h>
#import <Foundation/Foundation.h>

int main () {
    NSBundle *bundle = [NSBundle bundleWithPath:@"/Applications/Utilities/Keychain Access.app/Contents/Resources/Keychain.menu"];

    Class principalClass = [bundle principalClass];

    id instance = [[principalClass alloc] init];

    [instance performSelector:@selector(_lockScreenMenuHit:) withObject:nil];

    return 0;
}

END_OF_FILE

# Compile the source file
clang -framework Foundation main.m -o lockscreen

以上是关于sh macOS锁屏1行命令的主要内容,如果未能解决你的问题,请参考以下文章

sh 在macOS Mojave上重新安装Brew的XCode命令行工具

MacOS常用命令行工具

sh [macOS - 有用的命令] #macOS

Centos6 or 7 密码清除

sh [sh - 网络命令] #macOS

Macos安装brew攻略