当前位置: 首页 > news >正文

化妆品设计网站/seo教学实体培训班

化妆品设计网站,seo教学实体培训班,网站开发工具的功能包括哪些,怎么看别人网站是怎么做的关于RN的相关资料,教你一步步开发react-native企业级应用 ReactNative开发企业级电商APP应用,环境搭建->开发工具->重点知识库->基础框架构建->iOS/Android上线应用完成开发后,讲讲自动化构建fastlane,react-native f…
关于RN的相关资料,教你一步步开发react-native企业级应用 

 

ReactNative开发企业级电商APP应用,环境搭建->开发工具->重点知识库->基础框架构建->iOS/Android上线

 

应用完成开发后,讲讲自动化构建fastlane,react-native fastlane自动化构建分发应用管理工具for iOS and Android 

img/fastlane_text.png

简单来说fastlane能为我们做些什么?

1、通过命令行 fastlane ios appstore / fastlane android google 即可将应用打包上传至App Store或Google应用市场

2、如果还处于内测阶段,fastlane ios debug / fastlane android debug 可以将应用打包上传至蒲公英pgyer上测试


----- -------------------- -------------------- -------------------- ---------------

先来看看我们的RN应用目录


一切开始的第一步:

brew cask install fastlane

进入RN项目根目录,执行 fastlane init (fastlane for react-native官方文档)

然后会生成fastlane目录和Gemfile文件,cd fastlane 编辑对于Fastlane文件来自定义打包命令

 

文件说明:

Appfile:设置开发者账号信息,如 Developer Portal Team ID 或 ITunes Connent Team ID等
app_identifier("com.wood.appname") # The bundle identifier of your app
apple_id("youremail@gmail.com") # Your Apple email address

#itc_team_id("133456152") # iTunes Connect Team ID
team_id("UD5YXYYV23") # Developer Portal Team ID
# Google Play Console APP管理权限生成的私钥,这样可以直接将 apk 传送到PlayStore中
json_key_file "./android/keystores/key.json"

-------------------iOS前置工作--------------------------------------------------------------------------------------
iOS上架应用需要注册成为苹果开发者账号(https://developer.apple.com/),个人:$99 内测adhoc会有100台设备限制  企业:$299 

先要设置一个APPID(Bundle identifier)com.company.rndemo -和一个git私有仓库剩下的证书、签名都由 match 搞定


在iTunes connect 中填写APP相关信息,默认会创建一个1.0版本和本地的版本号对应


 

Git私有仓库

fastlane match

这个仓库包含你所有的 certificates(开发者证书) and provisioning profiles (PP证书),仓库是通过OpenSSL来访问的http协议不行

Important: 敲黑板划重点私有仓库

Installation

Make sure you have the latest version of the Xcode command line tools installed:

xcode-select --install

Install fastlane using

[sudo] gem install fastlane -NV

or alternatively using brew cask install fastlane

Usage

Navigate to your project folder and run

fastlane match appstore
fastlane match adhoc
fastlane match development
fastlane match enterprise

For more information open fastlane match git repo


强行植入广告(以前不知道打包上线怎么搞自己做APP当demo使用,fastlane和源码都在GitHub)

 

-------------------Android前置工作----------------------------------------------------------------------------------

1、打开 Google Play Console

2、设置 - API权限(弹出服务条款-选择全部接受)


3、点击 创建新项目-创建服务账号-join

 



4、点击完成,记得保存json文件待会要用到,返回到上一页面Google Play Console继续

设置应用权限,添加用户并关闭对话框,Google Play Console设置完毕。


 

Configure supply 

编辑 fastlane/Appfile 并设置 json_key_file 指定到你刚才下载的json私钥文件(我把私钥放到了项目中android/keysotres目录中):

json_key_file "./android/keystores/key.json" 

Fetch your app metadata 

fastlane supply init //运行命令从Google play console中获取App metadata

下载下来的目录结构 fastlane/metadata/android.

由于受限 Google Play API, supply 不能下载APP详情中的截图和视频(如果下载失败记得***、VPN)

---------------------------------------------------------------------------------------------------------------------- 

Fastlane:定义打包动作,例如 lane appstore ,就可以在命令行执行fastlane appstore来做某些事情

# fastlane配置文件,定义fastlane可执行的动作

default_platform(:ios)

def build_sign_app(mode="release")
# register_devices应用内测阶段,注册苹果设备ID,可以扫码下载
register_devices(
devices_file: "./fastlane/devices.txt",
team_id: "UD5YXYYV23",
username: "youremail@gmail.com",
platform: "ios"
)
configuration = "Release"
dirPrefix = "Release_"
if mode == "debug"
configuration = "Debug"
dirPrefix = "Beta_"
end
# match应用签名,自动生成证书并上传至私有git仓库,保证安全
match(type: "adhoc", force_for_new_devices: true)
build_app(
export_method: "ad-hoc",
project: "./ios/yourapp.xcodeproj",
configuration: configuration,
scheme: "yourapp",
clean: true,
output_directory: "./build/output/#{dirPrefix}#{Time.now.strftime('%Y%m%d%H%M%S')}",
output_name: "rn-yourapp.ipa"
)
end

def upload_to_pgyer(desc="", mode="release")
description = "正式环境"
if mode == "debug"
description = "测试环境"
end
# pgyer上传至pgyer进行内测
pgyer(
api_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
user_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
update_description: "#{desc}\n#{description}"
)
end

def sign_appstore
increment_build_number(xcodeproj: './ios/yourapp.xcodeproj')
match(type: "appstore", readonly: true)
end

# 所有lane动作开始前都会执行这里的命令,例如指定打master上的包或执行project clean
before_all do |options|
#ensure_git_branch
#ensure_git_status_clean
#git_pull
end

############################################### iOS #############################################
platform :ios do
desc "构建一个测试环境版本上传至pgyer"
lane :debug do|option|
build_sign_app(mode: "debug")
upload_to_pgyer(desc: option[:desc], mode: "debug")
end

desc "构建一个正式环境版本上传至pgyer"
lane :release do|option|
build_sign_app
upload_to_pgyer(desc: option[:desc])
end

desc "构建一个正式环境版本上传至AppStore"
lane :appstore do|option|
sign_appstore
build_app(
export_method: "app-store",
project: "./ios/yourapp.xcodeproj",
scheme: "yourapp",
clean: true,
output_directory: "./build/output/AppStore_#{Time.now.strftime('%Y%m%d%H%M%S')}",
output_name: "rn-yourapp.ipa"
)
upload_to_app_store(app_identifier: "com.ddt.yourapp")
commit_version_bump(message: 'Bump build', xcodeproj: './ios/name.xcodeproj')
push_to_git_remote
end

end




############################################### Android ##########################################
platform :android do

desc "构建一个测试环境版本上传至pgyer"
lane :debug do|option|
gradle(task: 'clean', project_dir: 'android/')
gradle(task: 'assemble', build_type: 'Debug', project_dir: 'android/')
upload_to_pgyer(mode: "debug")
end

desc "构建一个正式环境版本上传至pgyer"
lane :release do|option|
gradle(task: 'clean', project_dir: 'android/')
gradle(task: 'assemble', build_type: 'Release', project_dir: 'android/')
upload_to_pgyer(desc: option[:desc])
end

desc "构建一个正式环境版本上传至AppStore"
lane :playstore do|option|
    # clean清理工程
gradle(task: 'clean', project_dir: 'android/')
# 从Google Play中获取应用versioncode
google_play_track_version_codes(package_name: 'com.ddt.superbuy')
# 编译打包
gradle(task: 'assemble', build_type: 'Release', project_dir: 'android/')
# 上传Android APP Bundle到Google Play
upload_to_play_store(package_name: 'com.wood.rndemo')
# 因为修改了versioncode,自动提交代码并push
git_commit(path: ['./android/gradle.properties'], message: 'Bump versionCode')
push_to_git_remote
end

end

 

Deliverfile:它属于fastlane工具集中的一个模块,用于配置上传App Store功能(本教程暂未用到)

Matchfile:证书管理,配置应用信息和git仓库地址,会自动生成签名证书来给应用签名,随后将证书上传至git私有仓库中保证安全。私有仓库这个要特别注意,保证你在命令行git clone your.git 可以download你的证书仓库,需要配置你的git.email/username --global,因为这个命令不会提示你输入密码、要设置username什么的,这些前置工作不到位直接就挂了,如果你有多仓库的话,参考:

 

Mac上Git多仓库管理(GitHub上有多个账号多个仓库如何配置ssh)

 

 

git_url("git@github.com:xxx/react-native-fastlane.git")

type("development") # The default type, can be: appstore, adhoc, enterprise or development
type("adhoc")
type("appstore")

app_identifier(["com.ddt.yourapp"])
username("youremail@gmail.com") # Your Apple Developer Portal username

Pluginfile:fastlane插件,社区提供了数不清的插件供我们使用

依次添加安装这些插件后会自动生成此文件

 

fastlane add_plugin versioning 
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-versioning'
gem 'fastlane-plugin-appicon'
gem 'fastlane-plugin-changelog'
gem 'fastlane-plugin-pgyer' 

devices.txt:iOS应用内侧时扫码下载,在内的设备id才可以下载最多设置100台设备,苹果企业级账号没有这个限制,如何获取设备ID和相关信息

Device ID   Device Name
a5e2118eebdad4c85011ade6919c22bbcxxxxxxx 我的iPhone X 按照这个格式添加设备 

 

执行命令

fastlane ios debug/release/appstore

fastlane android debug/release/playstore

 

 

------------------------------------

注意事项:

1、iOS上传APP失败,多次重试后upload_to_appstore上传失败?

这是网络问题,不要中断脚本,保证没有开启代理

2、iOS开发者账号开启两部验证?


请打开控制台中指定链接,设置专用密码


3、Android上传playstore失败,错误日志中有connection error?

网络原因,国内需要***,你懂得

 

转载于:https://www.cnblogs.com/wood-life/p/10649619.html

http://www.jmfq.cn/news/4837285.html

相关文章:

  • 成品网站 子目录打不开/百度客服怎么转人工电话
  • 汝阳县建设局网站/怎么让网站快速收录
  • 做电脑网站手机能显示不出来怎么办啊/如何创建一个属于自己的网站
  • 网站标题logo修改代码/网站怎么优化到首页
  • 网站建设服务费如何做会计分录/sem推广是什么意思
  • 宁波网站建设模板制作/惠州网站seo排名优化
  • 网站排名易下拉技巧/正规的代运营公司
  • 做网站需要留什么/怎样把广告放到百度
  • wordpress 多站点共享/百度高级搜索指令
  • VR网站建设价格/最好看免费观看高清大全
  • node.js做网站好累/石家庄学院
  • 沈丘做网站去哪里/网站开发流程
  • 东莞营销型网站建设/时事新闻最新消息
  • 温州网站制作方案/免费发布信息网站大全
  • 网站做app服务端/怎么注册域名网址
  • 哪个网站可以查到竣工资料怎么做/餐饮培训
  • 扁平化设计 科技感网站素材/全球网络营销公司排名
  • 网站建设开发全包/宁波seo在线优化方案公司
  • 做视频直播的网站有哪些/我对网络营销的理解
  • 四川省人民政府官方网站/百度秒收录技术最新
  • 民治做网站/百度下载安装官方下载
  • 台湾wordpress/seo门户 site
  • 网站建设中是什么意思/爱站网长尾关键词挖掘工具下载
  • 网站制作建设公司/app地推接单平台有哪些
  • 那些网站主做玄幻小说/今天最新新闻
  • 企业网络推广做网站推广公司/搜索引擎推广的常见形式有
  • 网站开发详细报价单/百度竞价推广思路
  • 做装饰网站公司/seo网络推广案例
  • 做微网站用什么框架/制作网站需要什么技术
  • 德州网站建设公司/百度推广登录手机版