打印/下载
设计模板
Android
iOS

模板( AdobeXD )

  • project/设计图/APP.xd
  • project/设计图/Screen.xd

使用技巧

  • 推荐“AdobeXD”设计APP,图标制作成矢量,便于导出 SVG 格式
  • 安装 Adobe Flutter 插件,复制 SVG 内容到 “lib/library/ui/ui-icons.dart” 方便使用
  • 在“APP.xd”设计图标和启动画面,复制到“Screen.xd”缩放成各种尺寸,Ctrl+e选择目录,覆盖对应文件

证书

# 存放目录
cd android/app/
# 生成签名文件(jks)
keytool -genkey -v -keystore key.jks -alias key -keyalg RSA -keysize 2048 -validity 20000
# 查看签名(sha1)
keytool -v -list -keystore key.jks

# keystore转jks
keytool -importkeystore -srckeystore XXX.keystore  -srcstoretype JKS -deststoretype PKCS12 -destkeystore key.p12
keytool -v -importkeystore -srckeystore key.p12  -srcstoretype PKCS12 -destkeystore key.jks -deststoretype JKS
keytool -importkeystore -srckeystore key.jks -destkeystore key.jks -deststoretype pkcs12

配置打包( android/key.properties )

storePassword=123456
keyPassword=123456
keyAlias=key
storeFile=key.jks

配置签名( android/app/build.gradle )

在android{}同级目录添加如下配置

def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {

buildType同级做如下修改,增加signingConfigs

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

打包

flutter build apk

相关文档

打包&上架

  • 编译: flutter build ios --release
  • Xcode打开: flutter > ios > Runner.xcworkspace
  • Profile: Signings & Capabilities > 填写BundleID和选择证书Profile文件
  • 证书: Build Signings > Code Signing > Release > 选择"开发或生产"
  • 测试IPA: Product > Archive > Ad Hoc > Export( 导出ipa文件 )
  • 提交上架: Product > Archive > iOS App Store > Upload( 提交到AppStore )
  • 切换账户: Xcode > Preferences > Accounts

MinimumOSVersion问题

  • flutter clean
  • flutter build ios --release
  • Xcode > Runner > Flutter > AppFrameworkInfo.plist ( MinimumOSVersion: 10.0 )
  • Xcode > Runner > Runner > Info.plist ( MinimumOSVersion: 10.0 )
  • Xcode > Runner > info > Deployment Target > ( 10.0 )

UniversalLink( 通用链接 )

https://webmis.vip/.well-known/apple-app-site-association

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "ABCDE12345(团队ID).com.example.app(包名)",
        "paths": ["/app/*"]
      }
    ]
  }
}

xcode > Capabilities > Associated Domains

applinks:webmis.vip
applinks:www.webmis.vip
  • 从这里填入的域名请求文件 apple-app-site-association
  • 测试: 发短信 "https://webmis.vip/app/" > 点击打开APP > 成功
{{copy}}