ios-simulator-app-installer icon indicating copy to clipboard operation
ios-simulator-app-installer copied to clipboard

upgrade to swift3 and Xcode8

Open tcurdt opened this issue 7 years ago • 7 comments

tcurdt avatar Sep 22 '16 23:09 tcurdt

+1 This branch builds and works on Xcode8 quite happily for me.

matthewellis avatar Jan 31 '17 17:01 matthewellis

+1 works well for me, any chance this could be merged @stepanhruda?

alasdairlaw avatar Apr 25 '17 13:04 alasdairlaw

@stepanhruda Is this project still active? Would love to see progress on this.

matthewellis avatar May 15 '17 10:05 matthewellis

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 avatar May 15 '17 10:05 tcurdt

@tcurdt Hey i would be very interested in your version if you could share it with me somehow

matthewellis avatar May 15 '17 10:05 matthewellis

@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 avatar May 28 '17 23:05 tcurdt

@tcurdt Thanks for sharing 👍

matthewellis avatar Jun 13 '17 10:06 matthewellis