/
Fastfile
37 lines (30 loc) · 1.31 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
lane :test do
# NOTES:
# - you will need to provide at least a keychain containing a valid identity (e.g. a certificate and private key)
# - - notice that you will not see a difference in the number of valid identities from 'security find-identity', if the identity in the provided keychain is already in your normal keychains.
# - you can provide as many provisioning profiles as you wish
# create empty keychain and dummy provisioning file
keychain_path = '/tmp/my.keychain'
profile_path = '/tmp/my.mobileprovision'
FileUtils.touch profile_path
system('security create-keychain -p mySecretPassword testing')
generated_path = File.expand_path("~/Library/Keychains/testing-db")
system("mv #{generated_path} #{keychain_path}")
# the magic
prepare_build_resources(
provisioning_profile_paths: [profile_path],
keychain_path: keychain_path,
keychain_password: 'mySecretPassword',
build: proc do |certificate, profiles|
UI.message("#{certificate} exists!") if File.exist?(certificate)
profiles.each do |installed, original|
UI.message("#{installed} exists!") if File.exist?(installed)
end
sh('security find-identity|wc -l')
end
)
sh('security find-identity|wc -l')
# clean up the generated files
FileUtils.rm profile_path
FileUtils.rm keychain_path
end