ios-simulator-app-installer
ios-simulator-app-installer copied to clipboard
upgrade to swift3 and Xcode8
+1 This branch builds and works on Xcode8 quite happily for me.
+1 works well for me, any chance this could be merged @stepanhruda?
@stepanhruda Is this project still active? Would love to see progress on this.
Feels pretty dead. I ended up writing my own much simpler version of it. If find the time I am happy share it - but no promises on when exactly :)
@tcurdt Hey i would be very interested in your version if you could share it with me somehow
@matthewellis here is the relevant part:
installer_path = "#{target_dir}/#{env}.app"
contents_path = File.join(installer_path, "Contents")
macos_path = File.join(contents_path, "MacOS")
resources_path = File.join(contents_path, "Resources")
icon_path = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
installer_name = "Install #{bundle_name}"
bin_path = "#{macos_path}/#{installer_name}"
mkdir_p macos_path, :verbose => false
mkdir_p resources_path, :verbose => false
cp icon_path, "#{resources_path}/#{installer_name}.icns", :verbose => false
script = <<-SCRIPT.gsub(/^\s*\|/,'')
|#!/bin/bash
|ABS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
|DIR=`dirname "$ABS"`
|xcrun simctl install booted "$DIR/../Resources/#{File.basename(app_path)}"
SCRIPT
open(bin_path, 'w') { |f| f << script }
chmod 0755, bin_path, :verbose => false
plist = <<-PLIST.gsub(/^\s*\|/,'')
|<?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>CFBundleExecutable</key>
| <string>#{installer_name}</string>
| <key>CFBundleIconFile</key>
| <string>#{installer_name}.icns</string>
| <key>CFBundleName</key>
| <string>#{installer_name}</string>
| <key>CFBundlePackageType</key>
| <string>APPL</string>
| <key>CFBundleSignature</key>
| <string>4242</string>
| </dict>
|</plist>
PLIST
open("#{contents_path}/Info.plist", 'w') { |f| f << plist }
cp_r app_path, "#{resources_path}", :verbose => false
build_command = %Q[ cd #{target_dir} \
&& zip -r -y '#{t.name}' #{File.basename(installer_path)} 1>/dev/null
]
It creates a macOS bundle that executes a shell script to install the app into the simulator. HTH
@tcurdt Thanks for sharing 👍