Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to swift3 and Xcode8 #30

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

upgrade to swift3 and Xcode8 #30

wants to merge 6 commits into from

Conversation

tcurdt
Copy link

@tcurdt tcurdt commented Sep 22, 2016

No description provided.

@tcurdt tcurdt mentioned this pull request Sep 22, 2016
@matthewellis
Copy link

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

@alasdairlaw
Copy link

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

@matthewellis
Copy link

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

@tcurdt
Copy link
Author

tcurdt commented May 15, 2017

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 :)

@matthewellis
Copy link

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

@tcurdt
Copy link
Author

tcurdt commented May 28, 2017

@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

@matthewellis
Copy link

@tcurdt Thanks for sharing 👍

dpogue added a commit to AyogoHealth/ios-simulator-app-installer that referenced this pull request Oct 26, 2017
Most of these changes came from
stepanhruda#30 with
further additions. Unfortunately those were all done in a working copy
without applying to git, so this commit doesn't reflect proper
attribution to the author(s).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants