mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2024-11-10 06:34:23 +00:00
Add build script
This commit is contained in:
parent
2122ea0a20
commit
cf4b786a01
4 changed files with 40 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ xcuserdata
|
|||
project.xcworkspace
|
||||
Carthage/Checkouts
|
||||
Carthage/Build
|
||||
Release
|
||||
|
|
22
build
Executable file
22
build
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
NAME='Touch Bar Simulator'
|
||||
|
||||
|
||||
rm -r Release 2>/dev/null
|
||||
|
||||
xcodebuild archive \
|
||||
-scheme "$NAME" \
|
||||
-archivePath Release/App.xcarchive
|
||||
|
||||
xcodebuild \
|
||||
-exportArchive \
|
||||
-archivePath Release/App.xcarchive \
|
||||
-exportOptionsPlist export-options.plist \
|
||||
-exportPath Release
|
||||
|
||||
cd Release
|
||||
rm -r App.xcarchive
|
||||
|
||||
# Prerequisite: npm i -g create-dmg
|
||||
create-dmg "${NAME}.app"
|
10
export-options.plist
Normal file
10
export-options.plist
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>teamID</key>
|
||||
<string>YG56YK5RN5</string>
|
||||
<key>method</key>
|
||||
<string>developer-id</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -49,6 +49,13 @@ Apple would never allow it as it uses private APIs.
|
|||
In short, it exposes the Touch Bar simulator from inside Xcode as a standalone app with added features. I [class-dumped](https://github.com/nygard/class-dump) a private Xcode framework and used that to expose a private class to get a reference to the Touch Bar window controller. I then launch that window and add a screenshot button to it. I've bundled the required private frameworks to make it work without Xcode. That's why the binary is so big.
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
```
|
||||
./build
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
|
Loading…
Reference in a new issue