PostProcessing StoreKit.framework

hi,
How can I upload storeKit framework with PostProcessBuildPlayer?

where can I find information about it?

it’s very difficult…

thanks

Pretty good tutorial/solution here: http://tuohuang.info/unity-automate-post-process/

thank you !!!

Also, I’ve recently started using a freely available editor tool called XUPorter that has been extremely helpful for adding custom files, frameworks, or compile/linker flags to an XCode project automatically. It works like a charm and is easily extendable/reusable in many situations - frankly, some tool like it built into Unity would be very welcome.

The tool is located here: GitHub - onevcat/XUPorter: Add files and frameworks to your Xcode project after it is generated by Unity 3D.

i can write a simple PostProcess
i found this in Ruby but it’s not work … :frowning:

#!/usr/bin/env ruby
#
# PostprocessBuildPlayer
#   Tested on Ruby 1.8.7, Gem 1.3.6, and xcodeproj 0.3.0
#   Created by akisute (http://akisute.com)
#   Licensed under The MIT License: http://opensource.org/licenses/mit-license.php
#
require 'rubygems'
require 'xcodeproj'
require 'pathname'
 
#
# Define utility functions
#
def add_system_frameworks_to_project(proj, framework_names, option=:required)
    proj.targets.each do |target|
        if target.name == "Unity-iPhone-simulator" then
            next
        end 
        framework_names.each { |framework_name|
            framework = proj.add_system_framework(framework_name)
            ref = Xcodeproj::Project::PBXBuildFile.new(proj, nil, { 'fileRef' => framework.uuid})
            if option == :optional then
                ref.settings = {"ATTRIBUTES" => ["Weak"] }
            end
            if target.respond_to?(:build_phases) then
                # xcodeproj 0.3.0 or greater
                phase = target.build_phases.find { |phase| phase.is_a?(Xcodeproj::Project::PBXFrameworksBuildPhase) }
                phase.build_files << ref
            else
                # xcodeproj 0.1.0
                phase = target.buildPhases.find { |phase| phase.is_a?(Xcodeproj::Project::PBXFrameworksBuildPhase) }
                phase.files << ref
            end
            puts "Added system framework: " + framework_name + " as " + option.id2name
        }
    end
end
 
#
# Define build directory path
# -> Will be suppried as argv if run by Unity
# -> Else, assume UNITY_PROJECT_ROOT/build is a build directory
#
buildpath = (ARGV[0]) ? ARGV[0] : File.expand_path(File.dirname($0)) + "/../../build"
puts "PostprocessBuildPlayer running on build directory: " + buildpath
 
#
# Add System frameworks required to build
#
projpath = buildpath + "/Unity-iPhone.xcodeproj"
proj = Xcodeproj::Project.new(projpath)
add_system_frameworks_to_project(proj, ["StoreKit", "Security", "CoreText", "MessageUI"], :required)
add_system_frameworks_to_project(proj, ["Twitter", "Social"], :optional)
proj.save_as(projpath)

this is not enough?:

#modify XCode pbxproj and add framework dependencies
pbxproj_path = os.path.join(install_path, 'Unity-iPhone.xcodeproj/project.pbxproj')
project = XcodeProject.Load(pbxproj_path)

project.add_file('System/Library/Frameworks/Accounts.framework', tree='SDKROOT', weak=True)
project.add_file('System/Library/Frameworks/AdSupport.framework', tree='SDKROOT', weak=True)
project.add_file('System/Library/Frameworks/Social.framework', tree='SDKROOT', weak=True)
project.add_file('usr/lib/libsqlite3.0.dylib', tree='SDKROOT')