From d98894eb114a9484e68954ffbbc77c6fa9aec622 Mon Sep 17 00:00:00 2001 From: Jan Brauer Date: Tue, 20 Aug 2013 09:31:48 +0200 Subject: [PATCH] Always copy embedded.mobileprovision The `embedded.mobileprovision` should always be copied over in the codesign step. Otherwise subsequent builds with a different provisioning profile will build an incorrect app bundle. Example use case: ``` rake enterprise # Build an adhoc distribution rake appstore # Build an appstore release ``` --- lib/motion/project/template/ios/builder.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/motion/project/template/ios/builder.rb b/lib/motion/project/template/ios/builder.rb index 413927ec..5c47373a 100644 --- a/lib/motion/project/template/ios/builder.rb +++ b/lib/motion/project/template/ios/builder.rb @@ -92,10 +92,8 @@ PLIST # Copy the provisioning profile. bundle_provision = File.join(bundle_path, "embedded.mobileprovision") - if !File.exist?(bundle_provision) or File.mtime(config.provisioning_profile) > File.mtime(bundle_provision) - App.info 'Create', bundle_provision - FileUtils.cp config.provisioning_profile, bundle_provision - end + App.info 'Create', bundle_provision + FileUtils.cp config.provisioning_profile, bundle_provision # Codesign. codesign_cmd = "CODESIGN_ALLOCATE=\"#{File.join(config.platform_dir(platform), 'Developer/usr/bin/codesign_allocate')}\" /usr/bin/codesign"