Permalink
Browse files

Add build script

  • Loading branch information...
1 parent 2122ea0 commit cf4b786a01dbe1a7e1063d692de1177ba13b4f57 @sindresorhus committed Mar 27, 2017
Showing with 40 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +22 −0 build
  3. +10 −0 export-options.plist
  4. +7 −0 readme.md
View
@@ -2,3 +2,4 @@ xcuserdata
project.xcworkspace
Carthage/Checkouts
Carthage/Build
+Release
View
22 build
@@ -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"
View
@@ -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>
View
@@ -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)

0 comments on commit cf4b786

Please sign in to comment.