unlimit 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 864ee31974d738b3a807e9dfc681453675c8076f9e99b5e92dc8996d7b14f115
4
- data.tar.gz: b6de9ff30673b7f7ee0ba00d9bb913c2192e7f6891cd39830fcf6874a6f110dd
3
+ metadata.gz: eba32d679ee469fe3d8409bb3ef56041a35af9702c6da8f08b2e2b73322e6ec9
4
+ data.tar.gz: 03e3577fb0c245213b3b95f9d9ebf1af8f71087c4323ac7ef36800ba419c095f
5
5
  SHA512:
6
- metadata.gz: dacc6bbd3d729b9ead635d2f09ce7ffc0832f65534ccc7aba0954f285b62fdf8b9ea6887372f7767c042784853daa007ec5ea44386f7503d2bfc78f105bbcfc5
7
- data.tar.gz: 6aa08686cd9bbeeefdaf74e1c2294671c07e1002493c5cf632d67010fc37eafa3041c8b2624a953aa125c17a7efb54dd23f8ad54a6a3fc4a0764a90abc941639
6
+ metadata.gz: 55aeddde38ec4c8959e712d1cddef076429bb3b6d7e6ef5a88506ce8aee93c3f1a1614df3e7ee094ede8cfac53d195c1f3534fd4a72cd4050ce51e0a48b685ab
7
+ data.tar.gz: a71051d83726106704497f030d2d381f7f7a6e02e11d263f303f0d71f49ad3f78be59e368baf010b7a4f66f6609d4e7bd0651b2007b865e6722cee2a41cf3de9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
+ ## [0.0.3](https://github.com/biocross/unlimit/releases/tag/0.0.3)
3
+ Released on 2019-08-24.
2
4
 
5
+ #### Added
6
+ - Unlimit now supports custom scripts after finishing! Just create an `.unlimit.yml` file in your project root, put your scripts in the `custom_scripts` key, and run unlimit.
7
+ - Added `--configuration` flag to set configuration file path manually (Default: `.unlimit.yml`)
3
8
 
4
9
  ## [0.0.2](https://github.com/biocross/unlimit/releases/tag/0.0.2)
5
10
  Released on 2019-08-15.
data/Gemfile.lock CHANGED
@@ -3,7 +3,8 @@ PATH
3
3
  specs:
4
4
  unlimit (0.0.2)
5
5
  configure_extensions
6
- fastlane
6
+ fastlane (>= 2.116.0)
7
+ highline
7
8
  plist
8
9
  xcodeproj
9
10
 
@@ -20,7 +21,7 @@ GEM
20
21
  public_suffix (>= 2.0.2, < 4.0)
21
22
  atomos (0.1.3)
22
23
  babosa (1.0.2)
23
- claide (1.0.2)
24
+ claide (1.0.3)
24
25
  colored (1.2)
25
26
  colored2 (3.1.2)
26
27
  commander-fastlane (4.4.6)
@@ -34,9 +35,9 @@ GEM
34
35
  digest-crc (0.4.1)
35
36
  domain_name (0.5.20190701)
36
37
  unf (>= 0.0.5, < 1.0.0)
37
- dotenv (2.7.4)
38
+ dotenv (2.7.5)
38
39
  emoji_regex (1.0.1)
39
- excon (0.65.0)
40
+ excon (0.66.0)
40
41
  faraday (0.15.4)
41
42
  multipart-post (>= 1.2, < 3)
42
43
  faraday-cookie_jar (0.0.6)
@@ -45,7 +46,7 @@ GEM
45
46
  faraday_middleware (0.13.1)
46
47
  faraday (>= 0.7.4, < 1.0)
47
48
  fastimage (2.1.5)
48
- fastlane (2.128.1)
49
+ fastlane (2.129.0)
49
50
  CFPropertyList (>= 2.3, < 4.0.0)
50
51
  addressable (>= 2.3, < 3.0.0)
51
52
  babosa (>= 1.0.2, < 2.0.0)
@@ -163,7 +164,7 @@ GEM
163
164
  unf_ext (0.0.7.6)
164
165
  unicode-display_width (1.6.0)
165
166
  word_wrap (1.0.0)
166
- xcodeproj (1.11.0)
167
+ xcodeproj (1.12.0)
167
168
  CFPropertyList (>= 2.3.3, < 4.0)
168
169
  atomos (~> 0.1.3)
169
170
  claide (>= 1.0.2, < 2.0)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Unlimit 🚀📲
1
+ # Unlimit 🚀📲 [![Gem Version](https://badge.fury.io/rb/unlimit.svg)](https://badge.fury.io/rb/unlimit)
2
2
 
3
3
  Unlimit is a simple tool to quickly run your app on your device without worrying about the 100 device limit per developer account set by Apple. It achieves this by temporarily switching your Xcode Project to your [free](https://github.com/biocross/unlimit#do-i-require-a-paid-apple-developer-account-to-use-this) personal team (`Personal Team`).
4
4
 
@@ -8,18 +8,6 @@ Unlimit is a simple tool to quickly run your app on your device without worrying
8
8
 
9
9
  **Note that all changes unlimit makes to your project are local on your mac, and do not in anyway affect the configuration on your Apple Developer Portal.**
10
10
 
11
- ### Why can't I just do it myself?
12
-
13
- Well, you can, if your project is simple. However, if your project has capabilities like **Push Notifications**, **Background Modes** & **App Extensions**, things get complicated, since these require you to configure your `Personal Team` with all these entitlements. Unlimit gets rid of all this mess, and gets you quickly up and running on your device.
14
-
15
- ### What's the catch?
16
-
17
- Well, since unlimit temporarily removes capabilities like **App Extensions, Push Notifications** & more from your project, you **cannot** test these features on your device when using your personal team.
18
-
19
- ### How do I undo unlimit's changes?
20
-
21
- We recommend you run unlimit when you have no staged changes, so that you can simple go back by running `git reset --hard` when you're done testing on your device.
22
-
23
11
  ## Installation
24
12
 
25
13
  If your iOS/Mac project does not have a `Gemfile` yet, [learn how to set it up here](https://www.mokacoding.com/blog/ruby-for-ios-developers-bundler/). It's highly recommended you use [**bundler**](https://bundler.io/) to maintain consistent versions of tools like `cocoapods`, `fastlane` etc within your team.
@@ -43,6 +31,8 @@ After installing the gem, just run:
43
31
 
44
32
  and unlimit will do it's magic.
45
33
 
34
+ If you need to perform additional actions after unlimit finishes, see [custom scripts](https://github.com/biocross/unlimit#custom-scripts).
35
+
46
36
  ## Parameters
47
37
  All these parameters are optional, as unlimit can **autodetect** most of these. You can use these when unlimit is unable to figure them out, or to pass in overrides.
48
38
 
@@ -52,14 +42,51 @@ All these parameters are optional, as unlimit can **autodetect** most of these.
52
42
  | `target` | The **app target** you want to run on your device | `--target MyApp` |
53
43
  | `plist` | The **path** to your app's **Info.plist** file | `--plist MyApp/MyApp-Info.plist` |
54
44
  | `team_id` | The Code Signing **Team ID** to use | `--team_id A1B2C3D4E5A` |
45
+ | `configuration` | The configuration file to use to read your custom scripts, defaults to `.unlimit.yml` (See below) | `--configuration config.yml` |
55
46
  | `keep_fabric` | Unlimit automatically disables Fabric's build phase script, to avoid the annoying `New app ID added` email sent by Fabric. Use this flag for keep the Fabric script. (Note: This does not affect Fabric/Crashlytics functionality, only disables it's dSYM uploading shell script) | `--keep_fabric` |
56
47
  | `version` | Print the current unlimit version you're using and exit | `--version` |
57
48
 
49
+ ## Custom Scripts
50
+
51
+ To perform additional actions after unlimit finishes, use custom scripts!
52
+
53
+ Just create an `.unlimit.yml` file in your project root, and put in your scripts inside the `custom_scripts` array:
54
+
55
+ For example, the following unlimit file runs a script to modify a plist using PlistBuddy:
56
+
57
+ ```yaml
58
+ custom_scripts:
59
+ - /usr/libexec/PlistBuddy -c "Set :AppGroup UNLIMIT_APP_GROUP_NAME" UNLIMIT_PLIST_PATH
60
+
61
+ ```
62
+ Like the above script, You can use a few handy variables that unlimit will automatically replace with real values in your scripts:
63
+
64
+ | Variable | Description |
65
+ | --- | --- |
66
+ | `UNLIMIT_PROJECT_PATH` | The path to the current **.xcodeproj** |
67
+ | `UNLIMIT_TARGET_NAME` | The current target name |
68
+ | `UNLIMIT_PLIST_PATH` | The **path** to your target's **Info.plist** file |
69
+ | `UNLIMIT_TEAM_ID` | The Code Signing **Team ID** in use |
70
+ | `UNLIMIT_APP_BUNDLE_ID` | The unique app **bundle ID** generated by unlimit |
71
+ | `UNLIMIT_APP_GROUP_NAME` | The **app group id** generated by unlimit |
72
+
58
73
  ## Contributing
59
74
 
60
75
  Bug reports and pull requests are welcome. Any feedback or feature suggesions are also encouraged.
61
76
 
62
- ## More FAQs
77
+ ## FAQs
78
+
79
+ ### Why can't I just do it myself?
80
+
81
+ Well, you can, if your project is simple. However, if your project has capabilities like **Push Notifications**, **Background Modes** & **App Extensions**, things get complicated, since these require you to configure your `Personal Team` with all these entitlements. Unlimit gets rid of all this mess, and gets you quickly up and running on your device.
82
+
83
+ ### What's the different between using unlimit and running on a registered device?
84
+
85
+ Well, since unlimit temporarily removes capabilities like **App Extensions, Push Notifications** & more from your project, you **cannot** test these features on your device when using your personal team.
86
+
87
+ ### How do I undo unlimit's changes?
88
+
89
+ We recommend you run unlimit when you have no staged changes, so that you can simple go back by running `git reset --hard` when you're done testing on your device.
63
90
 
64
91
  ### Do I require a paid apple developer account to use this?
65
92
 
data/bin/unlimit CHANGED
@@ -12,6 +12,7 @@ OptionParser.new do |opt|
12
12
  opt.on('--plist INFO_PLIST') { |o| options['plist_path'] = o }
13
13
  opt.on('--target TARGET_NAME') { |o| options['target_name'] = o }
14
14
  opt.on('--team_id TEAM_ID') { |o| options['team_id'] = o }
15
+ opt.on('--configuration CONFIGURATION_YAML_FILE') { |o| options['configuration'] = o }
15
16
  opt.on('--keep_fabric') { |_o| options['keep_fabric'] = true }
16
17
  opt.on('--version') { unlimiter.showVersion }
17
18
  end.parse!
@@ -1,3 +1,3 @@
1
1
  module Unlimit
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/unlimit.rb CHANGED
@@ -4,6 +4,7 @@ require 'unlimit/version'
4
4
  require 'xcodeproj'
5
5
  require 'securerandom'
6
6
  require 'json'
7
+ require 'yaml'
7
8
  require 'plist'
8
9
  require 'open3'
9
10
  require 'highline'
@@ -13,11 +14,13 @@ PlistPathKey = 'plist_path'
13
14
  TargetNameKey = 'target_name'
14
15
  TeamIDKey = 'team_id'
15
16
  KeepFabricKey = 'keep_fabric'
17
+ ProjectConfigurationFileKey = 'configuration'
16
18
  InfoPlistBuildSettingKey = 'INFOPLIST_FILE'
17
19
  ProductTypeApplicationTarget = 'com.apple.product-type.application'
18
20
  FastlaneEnvironmentVariables = 'LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 FASTLANE_SKIP_UPDATE_CHECK=true'
19
21
  CapabilitiesWhitelist = ['com.apple.SafariKeychain'].freeze
20
22
  FastFilePath = 'fastlane/Fastfile'
23
+ DefaultProjectConfigurationFilePath = '.unlimit.yml'
21
24
  Divider = '================================================'
22
25
 
23
26
  module Unlimit
@@ -46,7 +49,9 @@ module Unlimit
46
49
  target_name = ''
47
50
  personal_team_id = ''
48
51
  uses_app_groups = false
52
+ app_group_name = ''
49
53
  entitlements_file = ''
54
+ project_configuration_file = ''
50
55
  extensions = []
51
56
  target = nil
52
57
 
@@ -114,6 +119,18 @@ module Unlimit
114
119
  end
115
120
  end
116
121
 
122
+ if options.key?(ProjectConfigurationFileKey)
123
+ project_configuration_file = options[ProjectConfigurationFileKey]
124
+
125
+ unless File.file?(project_configuration_file)
126
+ abort("YAML Configuration file not found at path: #{project_configuration_file}".red)
127
+ end
128
+ puts "Using YAML Configuration at path #{project_configuration_file}.".green
129
+ else
130
+ project_configuration_file = DefaultProjectConfigurationFilePath
131
+ putsWithOverrides('YAML Configuration', project_configuration_file, ProjectConfigurationFileKey)
132
+ end
133
+
117
134
  project.targets.each do |target|
118
135
  if target.product_type.include? 'app-extension'
119
136
  extensions.push(target.name)
@@ -155,7 +172,7 @@ module Unlimit
155
172
  end
156
173
  end
157
174
 
158
- puts "================================================\n"
175
+ puts "#{Divider}\n"
159
176
 
160
177
  # Turn off capabilities that require entitlements
161
178
  puts 'Turning OFF all Capabilities'.red
@@ -203,8 +220,9 @@ module Unlimit
203
220
  system("#{FastlaneEnvironmentVariables} bundle exec fastlane run update_app_identifier plist_path:#{plist_path} app_identifier:#{bundle_identifier}")
204
221
 
205
222
  if uses_app_groups # Create a temporary fastfile, and set the app group identifiers
223
+ app_group_name = "group.#{bundle_identifier}"
206
224
  fastfile = "lane :set_app_group do
207
- update_app_group_identifiers(entitlements_file: \"#{entitlements_file}\", app_group_identifiers: ['group.#{bundle_identifier}'])
225
+ update_app_group_identifiers(entitlements_file: \"#{entitlements_file}\", app_group_identifiers: ['#{app_group_name}'])
208
226
  end"
209
227
 
210
228
  existingFastfile = ''
@@ -233,6 +251,25 @@ module Unlimit
233
251
  system("bundle exec configure_extensions remove #{project_path} #{target_name} #{app_extensions}")
234
252
  end
235
253
 
254
+ if File.file?(project_configuration_file)
255
+ puts "Running Custom Scripts from #{project_configuration_file}".red
256
+ local_configuration = YAML.load_file(project_configuration_file)
257
+ unless local_configuration['custom_scripts'].empty?
258
+ environment_variables = { 'UNLIMIT_PROJECT_PATH' => project_path, 'UNLIMIT_TARGET_NAME' => target_name, 'UNLIMIT_PLIST_PATH' => plist_path, 'UNLIMIT_TEAM_ID' => personal_team_id, 'UNLIMIT_APP_BUNDLE_ID' => bundle_identifier, 'UNLIMIT_APP_GROUP_NAME' => app_group_name }
259
+ local_configuration['custom_scripts'].each do |script|
260
+ script = script.to_s
261
+ environment_variables.each do |key, variable|
262
+ script.gsub!(key.to_s, variable.to_s)
263
+ end
264
+ puts "Running: #{script}".green
265
+ output, stderr, status = Open3.capture3(script)
266
+ puts output unless output.empty?
267
+ puts stderr unless stderr.empty?
268
+ puts "Done with Status: #{status}"
269
+ end
270
+ end
271
+ end
272
+
236
273
  puts "\n#{Divider}"
237
274
  puts 'You\'re good to go! Just connect your device and hit run!'.green
238
275
  puts Divider
data/unlimit.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['Siddharth Gupta']
11
11
  spec.email = ['sids.1992@gmail.com']
12
12
 
13
- spec.summary = 'Test your iOS projects on device despite the 100 device limit'
13
+ spec.summary = 'Test your iOS projects on device despite the 100 device limit, by automatically switching to your personal team'
14
14
  spec.description = 'Test your iOS projects on device despite the 100 device limit, by automatically switching to your personal team'
15
15
  spec.homepage = 'https://github.com/biocross/unlimit'
16
16
  spec.license = 'MIT'
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  if spec.respond_to?(:metadata)
21
21
  spec.metadata['homepage_uri'] = spec.homepage
22
22
  spec.metadata['source_code_uri'] = 'https://github.com/biocross/unlimit'
23
- spec.metadata['changelog_uri'] = 'https://github.com/biocross/unlimit'
23
+ spec.metadata['changelog_uri'] = 'https://github.com/biocross/unlimit/blob/master/CHANGELOG.md'
24
24
  else
25
25
  raise 'RubyGems 2.0 or newer is required to protect against ' \
26
26
  'public gem pushes.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unlimit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siddharth Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-15 00:00:00.000000000 Z
11
+ date: 2019-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
@@ -138,7 +138,7 @@ licenses:
138
138
  metadata:
139
139
  homepage_uri: https://github.com/biocross/unlimit
140
140
  source_code_uri: https://github.com/biocross/unlimit
141
- changelog_uri: https://github.com/biocross/unlimit
141
+ changelog_uri: https://github.com/biocross/unlimit/blob/master/CHANGELOG.md
142
142
  post_install_message:
143
143
  rdoc_options: []
144
144
  require_paths:
@@ -157,5 +157,6 @@ requirements: []
157
157
  rubygems_version: 3.0.3
158
158
  signing_key:
159
159
  specification_version: 4
160
- summary: Test your iOS projects on device despite the 100 device limit
160
+ summary: Test your iOS projects on device despite the 100 device limit, by automatically
161
+ switching to your personal team
161
162
  test_files: []