1. 配置環境變量。
2. 測試adt指令
3. 将shepherdphone0815.mobileprovision和 my.p12檔案都放入編譯好的工程目錄下,如下圖:
4.切換到上述編譯好的目錄:
cd d:\flash builder\workspaces\shepherduniformphone\bin-debug
5. 輸入打包指令:
adt -package -target ipa-test-interpreter -provisioning-profile shepherdphone0815.mobileprovision -storetype pkcs12 -keystore my.p12 -storepass shepherd shepherdphone.ipa
shepherduniformphone-app.xml shepherduniformphone.swf spring.swf summer.swf autumn.swf winter.swf ./com
6. 打包說明:
6.1
針對ios平台,air應用程式既可以使用aot模式(ahead of time)也可以使用解釋器模式打包。想要了解詳細細節,請參閱早先釋出的這篇文章:
使用adt(譯者:adt是使用指令行的air編譯工具)可以選擇以上兩種打包模式。
其中,支援aot模式的target參數值為ipa-app-store,ipa-ad-hoc,ipa-test和ipa-debug;
支援解釋器模式的值為ipa-debug-interpreter,ipa-test-interpreter,ipa-debug-interpreter-simulator和ipa-test-interpreter-simulator。在解釋器模式中,swf檔案被動态解釋,并沒有轉換成本地的機器碼,是以使用這種模式運作效率相對aot模式要慢(譯者:運算密集型應用比較明顯)。我們建議所有的開發者在正式釋出到應有商店時,都選擇aot模式。要了解adt的指令和參數細節,請參閱這篇文章:
6.2
首先說一下adt指令的方式:首先下載下傳并安裝flex4.1sdk、air2.6sdk和runtime,用flasbuilder建立一個air工程,簡單建立幾個顯示對象到舞台上,測試運作沒有問題在進行下一步;之後到工程根目錄bin-debug下打開cmd輸入以下指令:
"d:\program files\adobe\fb4\adobe flash builder 4\sdks\4.1.0\bin\adt" -package -target ipa-test -provisioning-profile embedded.mobileprovision -storetype pkcs12 -keystore testkey.p12 airtest.ipa airtest-app.xml airtest.swf
詳細說明一下:"d:\program files\adobe\fb4\adobe flash builder 4\sdks\4.1.0\bin\adt"為airsdk下adt指令的位置,-package是打包操作的參數,-target ipa-test是執行打包成ipa檔案,-provisioning-profile embedded.mobileprovision是apple的開發者授權檔案(包含路徑),-storetype pkcs12是密匙類型,-keystore testkey.p12是密匙檔案(包含路徑),airtest.ipa是打包為ipa檔案的檔案名,airtest-app.xml是應用的配置檔案(包含路徑),airtest.swf是編譯後生成的swf檔案(包含路徑)。注:testkey.p12為flashbuilder打包air是建立的密匙檔案。
執行後會提示輸入密碼即建立密匙檔案是輸入的密碼,之後等待生成ipa檔案即可
如果加載多個swf檔案:
則:
1. swf的檔案托管:
2. 配置檔案的托管配置:
3. adt打包指令:
adt -package -target ipa-test -provisioning-profile shepherdphone0815.mobileprovision -storetype pkcs12 -keystore my.p12 -storepass shepherd shepherdphone.ipa shepherduniformphone-app.xml
shepherduniformphone.swf ./txt/sherherdswfinfofile.txt spring.swf summer.swf autumn.swf winter.swf ./com
4. 生成檔案夾:
此時、生成的swf檔案中不含有abc位元組碼,将這些swf檔案部署到伺服器中,可使用。
另外,生成的ipa檔案,将不包含這些swf檔案。
5. 使用伺服器的swf檔案