Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可否支持生成无签名的 IPA 文件? #187

Open
twinstar6980 opened this issue May 30, 2024 · 1 comment
Open

可否支持生成无签名的 IPA 文件? #187

twinstar6980 opened this issue May 30, 2024 · 1 comment

Comments

@twinstar6980
Copy link

在没有苹果开发者账号的情况下,无法直接打包 IPA 文件,但是可以制作无签名的 IPA 文件。
只需要将 flutter build ios 命令生成的 Runner.app 放置在一个空的 Payload 目录,之后压缩为 zip 并修改后缀名为 ipa
虽然不能上架 appstore ,但可以将无签名的 IPA 直接分发给用户,让用户通过 AltStore 、TrollStore 等工具自签并安装。

@canxin121
Copy link

补充一下,如果无须上架,你还需要xcrun bitcode_strip来减小ipa的体积,否则特别大

#!/bin/bash

# 定义框架目录
FRAMEWORK_DIR="./build/ios/iphoneos/Runner.app/Frameworks"

# 遍历所有的.framework文件夹
for framework in "$FRAMEWORK_DIR"/*.framework; do
    # 获取文件夹名称
    name=$(basename "$framework" .framework)
    # 检查文件是否存在
    if [ -f "$framework/$name" ]; then
        # 执行bitcode_strip命令
        xcrun bitcode_strip "$framework/$name" -r -o "$framework/$name"
    else
        echo "文件不存在: $framework/$name"
    fi
done

# 遍历所有的.dylib文件
for dylib in "$FRAMEWORK_DIR"/*.dylib; do
    # 检查文件是否存在
    if [ -f "$dylib" ]; then
        # 执行bitcode_strip命令
        xcrun bitcode_strip "$dylib" -r -o "$dylib"
    else
        echo "文件不存在: $dylib"
    fi
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants