Skip to content

A document introduce how to build、distribute ipa file one step in command line. You can select ipa distribute platform such as pgyer、fir.im or TestFlight use fastlane.

Notifications You must be signed in to change notification settings

purplepeng/IPALane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

IPALane

#ipa打包、分发测试

##1.打包

###xcodebuild Apple的命令行打包工具 #####下载xcodebuild(Command Line Tools Package) 或 命令行执行xcode-select --install #####使用举例:导出ipa包

  • xcodebuild clean install
  • xcodebuild -project marathon.xcodeproj -scheme marathon archive -archivePath ./
  • xcodebuild -exportArchive -exportFormat IPA -archivePath ../marathon.xcarchive -exportPath ./

###xctool

  • xctool是Apple的xcodebuild基础上的封装;操作更简便

###shenzhen

  • 命令行生成、分发ipa包到各平台(iTunes Connect、fir.im等)
  • 支持命令行方式查看ipa信息

###gym

##2.分发平台

###蒲公英

  • 支持命令行分发ipa

###fir.im

  • 非企业账号安装app需要添加UDID
  • 支持命令行生成、分发ipa

###TestFlight(iTunes Connect)

  • 内部测试者:最多25个
  • 外部测试者:最多1000个
    • 不需要添加UDID,只需要提供邮箱

##3.分发 ###Fastlane

ipa

##4.方案 ###非TestFlight分发测试

###TestFlight分发测试

##5.举例(Fastlane) ###5.1 安装以下工具

###5.2 配置Xcode工程文件

###5.3 运行Fastlane命令后,配置Fastfile

  • lane beta(TestFlight) 配置如下

     lane :beta do
     sigh
     ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]
     gym(scheme: "marathon")
     deliver(beta: true)    
    end
    
  • lane pgyer(蒲公英) 配置如下

     lane :pgyer do
     ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]
     gym(scheme: "marathon",use_legacy_build_api: true)
     sh "../pgyer.sh"
    
    end
    
  • lane fir(fir.im) 配置如下

     lane :fir do
     ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]
     gym(scheme: "marathon",use_legacy_build_api: true)
     sh "../fir.sh"
    
    end
    
  • 参照CodeSigning->Best Solution: Using environment variables

###5.4 配置渠道脚本

####pgyer.sh(蒲公英)

	pwd
	#切换到目标目录
	cd ..
	pwd
	
	#替换ipa文件名
	curl -F "file=@{$filePath}" \
	#替换uKey(User Key)和_api_key(API Key)
	-F "uKey={$uKey}" \
	-F "_api_key={$apiKey}" \
	http://www.pgyer.com/apiv1/app/upload
    

其中:

  • {$filePath}是应用安装包文件的路径
  • {$uKey}是开发者的用户 Key,在应用管理-API中查看
  • {$apiKey}是开发者的 API Key,在应用管理-API中查看

蒲公英

####fir.sh(fir.im)

	pwd
	#切换到目标目录
	cd ..
	pwd
	
	#发布应用到fir.im(配置生成的ipa名和fir.im API  Token)
	fir p path/to/application -T YOUR_FIR_TOKEN
    

fir-cli

###5.5 工程目录结构

  • projectName
    • framework
    • projectName
    • projectName.xcodeproj
    • projectNameTests
    • fastlane
      • Appfile
      • Deliverfile
      • Fastfile
    • fir.sh
    • pgyer.sh

##6.常见问题 ###6.1 Ruby类库安装不了?选择RubyGems 镜像(淘宝网) ###6.2 fastlane配置文件中带自定义脚本,运行命令时出现 Permission denied - ../xx.sh

  • 是脚本文件权限不够,修改脚本权限:sudo chmod a+x ./xx.sh

###TODO

  • deliver/fastlane分发ipa到iTunes Connect不支持TestFlight?
    • fastlane已支持TestFlight
  • 管理provision
  • IPALane优化

About

A document introduce how to build、distribute ipa file one step in command line. You can select ipa distribute platform such as pgyer、fir.im or TestFlight use fastlane.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published