flutter iOS Xcode打包并导出ipa文件安装包
1、 Xcode配置
1、 启动打包
1、 等待打包
1、 打包完成、准备导出ipa
1、 选择模式
1、 选择配置文件
1、 导出
1、 选择导出位置
1、 得到ipa
podfile文件如下
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
use_frameworks!
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'DKPhotoGallery','0.0.17', :modular_headers => true
pod 'SDWebImage','5.17.0', :modular_headers => true
pod 'FirebaseSessions','10.12.0', :modular_headers => true
pod 'FirebaseCore','10.6.0', :modular_headers => true
pod 'FirebaseCoreExtension','10.12.0', :modular_headers => true
pod 'FirebaseInstallations','10.12.0', :modular_headers => true
pod 'GoogleDataTransport','9.2.3', :modular_headers => true
pod 'GoogleUtilities','7.11.4', :modular_headers => true
pod 'nanopb','2.30909.0', :modular_headers => true
use_frameworks!
end
post_install do |installer|
//会因为下面这块run不起来,但是product- archive打不了包
# installer.generated_projects.each do |project|
# project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
# end
# end
# end
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Start of the permission_handler configuration
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1',
]
end
# End of the permission_handler configuration
end
end
原来是这样子的,删掉了一部分代码文章来源:https://www.toymoban.com/news/detail-615236.html
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
# Start of the permission_handler configuration
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1',
]
end
# End of the permission_handler configuration
end
end
文章来源地址https://www.toymoban.com/news/detail-615236.html
到了这里,关于flutter 打包iOS安装包的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!