Skip to content

Commit

Permalink
写了基本使用说明
Browse files Browse the repository at this point in the history
  • Loading branch information
15038777234 committed Aug 25, 2017
1 parent b863a50 commit 8022379
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 7 deletions.
79 changes: 72 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,84 @@ typora-copy-images-to: ./image

**这个主要是方便我们以后操作文件**

## 第二部 配置存放plist文件的库
## 2 配置htdoc文件夹

![96D17FB4-4AEB-4DB4-931C-AA839EC56ECA](image/96D17FB4-4AEB-4DB4-931C-AA839EC56ECA.png)
下载 配置文件https://github.com/josercc/iPATools/blob/developer-josercc/htdocs.zip?raw=true

**我们要设置库名称为iPAToolsPlist如果是其他的需要通过iPATools 工具进行配置**
复制下载出来htdocs里面的全部文件到/Applications/MAMP/htdocs下

我们使用**SSH**的方式进行clone到我们的网站根目录**/Applications/MAMP/htdocs**
## 3 Git Clone 项目

![668DA803-EABD-42FF-BA5C-FD2551B9BEB9](image/668DA803-EABD-42FF-BA5C-FD2551B9BEB9.png)
打开项目https://github.com/iPATools/iPAToolPlist

**为什么我们要使用SSH的方式呢?因为使用SSH这样对于我们脚本执行上传很方便!**
![31ADE152-E4C9-4EE1-B5EB-C32F8F65BF84](image/31ADE152-E4C9-4EE1-B5EB-C32F8F65BF84.png)

我们在**/Applications/MAMP/htdocs**新建一个文件夹ipa用来存放我们打包出来的ipa安装包
Fork项目之后Clone自己的项目到/Applications/MAMP/htdocs下

**需要注意的是必须使用SSH进行Clone这样是为了让命令行不需要输入账号和密码就可以上传文件了**

## 4.安装Jenkins

下载Jenkins https://jenkins.io/download/thank-you-downloading-osx-installer-stable

之后启动

## 5 安装Fastlane

前往https://github.com/fastlane/fastlane查看安装文档

## 6 下载iPATools

前往https://github.com/josercc/iPATools/releases下载最新的Release

## 7 配置工程Fastlane文件

```ruby

def archiveipa(configuration)
time = Time.new
version = get_version_number(xcodeproj: "xcodepro文件名称")
build_number_int = Time.new.to_i
build_name = version + "." + build_number_int.to_s
set_info_plist_value(key:"CFBundleVersion", value:build_name, path: "Info.plist相对路径")
output_directory = "/Applications/MAMP/htdocs/ipa/"
output_name = "APP名称_" + configuration + "_" + version + "_" + build_number_int.to_s
gym(scheme: 'scheme名称', export_method: 'ad-hoc', configuration: configuration, output_directory: output_directory, output_name:output_name, clean:true)
end

lane :beta do |values|
archiveipa "Debug"
end

lane :applive do |values|
archiveipa "Release"
end
```

## 8 配置jenkins

![5C6583F6-3228-433E-A37F-E614678EA5B9](image/5C6583F6-3228-433E-A37F-E614678EA5B9.png)

新建执行脚本

```ruby
#!/bin/bash
fastlane beta // 执行打包版本
cd /Applications
iPATools public // 执行iPATools进行发布
cd /Applications/MAMP/htdocs/iPAToolPlist /// 上传配置文件到github
git add .
git commit -m "change"
git push
```

这样每次使用Jenkins打包完毕就会自动上传进行在线安装了。

![8AC4676C-9B19-4295-BE61-BD9C99C02BC4](image/8AC4676C-9B19-4295-BE61-BD9C99C02BC4.png)

安装界面有点丑但是实用

这样我们就可以打开0.0.0.0:8888进行安装了

**如果想通过内网让其他同事安装必须设置iPATools server为你本机的ip**

Binary file added image/31ADE152-E4C9-4EE1-B5EB-C32F8F65BF84.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/5C6583F6-3228-433E-A37F-E614678EA5B9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/8AC4676C-9B19-4295-BE61-BD9C99C02BC4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8022379

Please sign in to comment.