Skip to content

Commit 7b6dd0c

Browse files
committed
macOS notes.
1 parent 5f74817 commit 7b6dd0c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

macOS.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# macOS Notes
2+
3+
## Useful commands
4+
5+
### Check the architecture of a binary
6+
7+
```
8+
$ file SUEX_HelloWorld.bundle
9+
SUEX_HelloWorld.bundle: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
10+
SUEX_HelloWorld.bundle (for architecture x86_64): Mach-O 64-bit bundle x86_64
11+
SUEX_HelloWorld.bundle (for architecture arm64): Mach-O 64-bit bundle arm64
12+
```
13+
14+
### Check the deployment target
15+
16+
It appear that x86_64 and arm64 binaries doesn't report the same way.
17+
18+
```
19+
$ otool -arch x86_64 -l SUEX_HelloWorld.bundle | grep -A 5 LC_VERSION_MIN_MACOSX
20+
cmd LC_VERSION_MIN_MACOSX
21+
cmdsize 16
22+
version 10.13
23+
sdk 11.3
24+
Load command 8
25+
cmd LC_SOURCE_VERSION
26+
```
27+
28+
```
29+
$ otool -arch arm64 -l SUEX_HelloWorld.bundle | grep -A 5 LC_BUILD_VERSION
30+
cmd LC_BUILD_VERSION
31+
cmdsize 32
32+
platform 1
33+
minos 11.0
34+
sdk 11.3
35+
ntools 1
36+
```

0 commit comments

Comments
 (0)