上傳App Store報錯信息記錄

ITMS-90171

ITMS-90171: Invalid Bundle Structure - - The binary file (ITMS-90171:包結構無效--不允許使用二進制文件)。

應用程序不能包含獨立的可執行文件或庫,只能包含受支持捆綁包的有效CFBundleExecutable。

處理方法 :

查看Build phases下面的Copy Bundle Resources下面是否存在錯誤中提示的文件或庫,如果存在,將其刪掉。

ITMS-90087

ITMS-90087:Unsupported Architectures.The executable for XXX.app/Frameworks/NMCBasicModuleFramework.framework contains unsupported architectures '[i386,x86_46]' (可執行的文件XXX. app/Frameworks/NMCBasicModuleFramework.framework包含不受支持的體系結構“[i386,x86_46]”)。

成因 :由于 iOS 編譯的特殊性,為了方便開發者在模擬器調試,很多 SDK 將i386、x86_64、armv7、arm64幾個平臺都合并到了一起。在開發階段都沒有問題,但生產編譯上傳到 App Store 時,需要將i386和x86_64兩個平臺的庫刪除,否則無法正常提交審核。

項目手動集成了網易云信,并且引入了網易云信處理手動集成提供的腳本,腳本如下:

#!/bin/sh

# Strip invalid architectures

strip_invalid_archs() {
binary="$1"
echo "current binary ${binary}"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
if [ -f "$binary" ]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

strip_invalid_archs "$FRAMEWORK_EXECUTABLE_PATH"
done

但是打包上傳之后仍舊報錯了,經過多次排查,再打包的輸出信息中發現了這種警告 :warning:skipping copy phase strip, binary is code signed(警告:跳過復制相位條,二進制是有符號的)。后來才發現是腳本執行時機造成的問題,如圖:

截屏2020-10-01上午12.20.55.png

ps:

Xcode創建shell腳本文件腳本的地方:

截屏2020-10-01上午12.29.31.png

ps:

查看打包時的輸出:

截屏2020-10-01上午12.36.41.png

Guideline 4.3 - Design

We noticed that your app provides the same feature set as other apps submitted to the App Store; it simply varies in content or language, which is considered a form of spam.

The next submission of this app may require a longer review time, and this app will not be eligible for an expedited review until this issue is resolved.

Next Steps

  • Review the Design section of the App Store Review Guidelines.
  • Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer Program.
  • Once your app is fully compliant, resubmit your app for review.

When creating multiple apps where content is the only varying element, you should offer a single app to deliver differing content to customers. If you would like to offer this content for purchase, it would be appropriate to use the in-app purchase API.

Alternatively, you may consider creating a web app, which looks and behaves similar to a native app when the customer adds it to their Home screen. Refer to the Configuring Web Applications section of the Safari Web Content Guide for more information.

Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination.

譯:

準則4.3-設計

我們注意到,您的應用程序提供的功能集與提交到應用程序商店的其他應用程序相同;它只是在內容或語言上有所不同,這被視為垃圾郵件的一種形式。

下次提交此應用程序可能需要更長的審閱時間,在解決此問題之前,此應用程序將沒有資格進行快速審閱。

下一步

-查看App Store Review Guidelines的設計部分。
-確保你的應用程序符合app Store審查指南的所有章節以及Apple開發者程序的條款和條件。
-一旦你的應用程序完全兼容,請重新提交你的應用程序以供審查。

當創建多個應用程序時,內容是唯一不同的元素,您應該提供一個應用程序來向客戶交付不同的內容。如果您想提供此內容以供購買,則使用應用內購買API是合適的。

或者,您可以考慮創建一個web應用程序,當客戶將其添加到主屏幕時,它的外觀和行為類似于本機應用程序。有關詳細信息,請參閱《Safari Web內容指南》的“配置Web應用程序”部分。

提交旨在誤導或傷害客戶或逃避審查過程的應用程序可能會導致您的Apple開發者程序帳戶終止。請查看Apple Developer Program的條款和條件,以了解有關終止的更多政策。

處理方法 :

可以嘗試使用KLGenerateSpamCode工具混淆代碼后再次嘗試上傳,KLGenerateSpamCode的GitHub地址:https://github.com/klaus01/KLGenerateSpamCode

KLGenerateSpamCode簡單使用記錄:

  • 1.使用Xcode打開KLGenerateSpamCode項目 -> Product -> Scheme -> Edit Scheme,然后選中 Run -> Arguments -> Arguments Passsd On Launch

如圖:

截屏2020-04-18下午2.03.37.png
截屏2020-04-18下午4.20.49.png
  • 2.填入操作項,可操作項目如下:
  1. (必填) 源碼文件夾絕對路徑(如:/Users/shawn/Desktop/iOS-YiShopCustomer-GuangYuan/YiShopCustomer)。

如圖 :

截屏2020-04-18下午4.30.42.png
截屏2020-04-18下午4.33.22.png
  1. -modifyProjectName [原名稱]>[新名稱] 修改工程名。程序會修改原名稱-Swift.h、Podfile、原名稱-Bridging-Header.h、源碼文件夾絕對路徑、原名稱.xcodeproj和原名稱.xcworkspace的名稱和內容。Podfile被修改后需要手動pod install。

例如 :

格式:-modifyProjectName [原名稱]>[新名稱]

示例:-modifyProjectName WxsTestDemo3>WxsTestDemo4

如圖 :

截屏2020-04-18下午4.40.42.png

保存后運行KLGenerateSpamCode項目,注意控制臺的輸出,如圖 :

截屏2020-04-18下午4.42.54.png

查看項目 :

截屏2020-04-18下午4.43.54.png
  1. -modifyClassNamePrefix [工程文件 xcodeproj 絕對路徑] [原前綴]>[新前綴] 修改源代碼類名前綴。程序會掃描源碼文件夾絕對路徑下的 .h .swift 文件,修改文件名,修改使用該類名的代碼,修改工程文件中的文件名。文件名有原前綴的會修改成新前綴,如:原前綴ViewController變成新前綴ViewController;沒有原前綴的會增加新前綴,如:ViewController變成新前綴ViewController。因為會有添加前綴的情況,操作完成后編譯檢查一下是否會有找不到文件的情況。

例如 :

格式:-modifyClassNamePrefix [工程文件 xcodeproj 絕對路徑] [原前綴]>[新前綴]

示例:-modifyClassNamePrefix /Users/shawn/Desktop/iOS-YiShopCustomer-GuangYuan/ZQOneCardSolution.xcodeproj YSC>ZQO

如圖 :

截屏2020-04-18下午5.14.07.png

保存后運行KLGenerateSpamCode項目,注意控制臺的輸出,如圖 :

截屏2020-04-18下午1.29.46.png

查看項目 :

原來 :

截屏2020-04-18下午5.18.55.png

現在 :

截屏2020-04-18下午5.17.52.png
  1. -spamCodeOut [垃圾代碼文件輸出目錄] [垃圾代碼方法增加的參數名] 生成垃圾代碼。程序會掃描源碼文件夾絕對路徑下的 .m .swift 文件中的類和方法,并生成category和extension文件,文件中的方法是在代碼原方法的基礎上增加垃圾代碼方法增加的參數名參數。如:-spamCodeOut /dir AppLog ,會將- (void)setupKeys {}生成為+ (BOOL)setupKeysAppLog:(NSInteger)AppLog { return AppLog % 20 == 0; },會將- (void)foo:(NSString *)str {}生成為+ (BOOL)fooAppLog:(NSInteger)AppLog { return AppLog % 23 == 0; }

例如 :

格式:-spamCodeOut [垃圾代碼文件輸出目錄] [垃圾代碼方法增加的參數名]

  1. -ignoreDirNames [忽略文件夾名稱字符串] 忽略這些文件夾,對-modifyClassNamePrefix、-spamCodeOut和-deleteComments參數有效。目前只會忽略源碼文件夾絕對路徑下一級的這些目錄。如:/p/s -ignoreDirNames categorys,那么/p/s/categorys會被忽略,但/p/s/viewControllers/categorys不會忽略。

例如 :

格式:-ignoreDirNames [忽略文件夾名稱字符串]

示例:-ignoreDirNames 第三方庫

  1. -handleXcassets 修改xxx.xcassets文件夾中的 png 資源文件名,同時也Contents.json文件中的關聯名稱,不會影響代碼中使用圖片。

例如 :

格式:-handleXcassets

如圖 :

截屏2020-04-18下午6.03.10.png

保存后運行KLGenerateSpamCode項目,注意控制臺的輸出,如圖 :

截屏2020-04-18下午6.02.50.png

查看圖片文件夾:

原來 :

截屏2020-04-18下午6.08.26.png

現在:

截屏2020-04-18下午6.08.36.png

7.-deleteComments 刪除工程目錄下 .h .m .swift 文件中的注釋和空行。

例如 :

格式:-deleteComments

如圖 :

截屏2020-04-18下午5.32.56.png

保存后運行KLGenerateSpamCode項目,注意控制臺的輸出,如圖 :

截屏2020-04-18下午5.31.56.png
另外修改圖片 hash 值的方法

使用 ImageMagick 對 png 圖片做輕量壓縮,既不損失圖片質量,又可改變圖片文件 hash 值。方法:

  1. 安裝 ImageMagick,brew install imagemagick
  2. 壓縮工程目錄下所有 png 文件,find . -iname "*.png" -exec echo {} \; -exec convert {} {} \;

執行下載https://www.python.org/ftp/python/3.8.2/python-3.8.2.tar.xz時,安裝過程會比較慢,可能會失敗,使用聯通的網絡會快一些,安裝成功后會有提示,例如:

==> python@3.8
Python has been installed as
  /usr/local/opt/python@3.8/bin/python3

You can install Python packages with
  /usr/local/opt/python@3.8/bin/pip3 install <package>
They will install into the site-package directory
  /usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have python@3.8 first in your PATH run:
  echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.bash_profile

For compilers to find python@3.8 you may need to set:
  export LDFLAGS="-L/usr/local/opt/python@3.8/lib"

For pkg-config to find python@3.8 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"

==> glib
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> libtool
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.

安裝成功后直接運行 find . -iname "*.png" -exec echo {} ; -exec convert {} {} ; 命令即可,之后會對圖片進行操作,如果為安裝成功,執行命令會提示:find: convert: No such file or directory

大神的使用經驗

只需要做如下修改就可以上馬甲包了:

    1. 修改工程名
    1. 修改類名前綴
    1. 修改圖片文件 Hash 值
    1. 修改 .xcassets 中的圖片文件名
    1. 用別的電腦打包
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容