def BuildIPA(ipafile): CopyExportOptionsPlist() ChmodSh() # curDir = "/Users/moon/Library/MobileDevice/Provisioning Profiles" curDir = "/Users/moon/Library/MobileDevice/Provisioning Profiles" DeleteProvisioningProfiles(curDir) RootDir = common.GetRootProjectIos() archive_file = RootDir + "/app.xcarchive" target = "Unity-iPhone" xcode_project = common.GetRootDirXcode() + "/Unity-iPhone.xcodeproj" flag = os.path.exists(archive_file) if flag: shutil.rmtree(archive_file) flag = os.path.exists(ipafile) if flag: shutil.rmtree(ipafile) RootDir = common.GetRootProjectIos() AppDir = RootDir + "/app" flag = os.path.exists(AppDir) if flag: shutil.rmtree(AppDir) AppDir = RootDir + "/app_export_ipa" flag = os.path.exists(AppDir) if flag: shutil.rmtree(AppDir) strCmd = "xcodebuild -allowProvisioningUpdates -project " + xcode_project + " -scheme " + \ target + " -configuration Release clean archive" + " -archivePath " + archive_file os.system(strCmd)
# common.SetCmdPath(cmdPath) isUploadIPA = False isExportIPA = False if count > 1: argv1 = sys.argv[1] if argv1 == "upload_ipa": isUploadIPA = True if argv1 == "export_ipa": isExportIPA = True # -u [email protected] -p ayww-hcnh-uaau-lsgh # xcodebuild -list RootDir = common.GetRootProjectIos() target = "Unity-iPhone" xcode_project = common.GetRootDirXcode() + "/Unity-iPhone.xcodeproj" archive_file = RootDir + "/app.xcarchive" # 不带后缀.ipa ipa_file = RootDir + "/app_inmobi/" + target exportOptionPlist_file = RootDir + "/ExportOptions.plist" if isUploadIPA == True: strCmd = "/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool --upload-app -f " + ipa_file + "/" + target + ".ipa" + " -t ios -u " + source.APPSTORE_USER + " -p " + source.APPSTORE_PASSWORD os.system(strCmd) else: # build target.app # strCmd = "xcodebuild -project " + xcode_project + " -target " + "Unity-iPhone" # os.system(strCmd) # archive if isExportIPA == False:
import os.path import time, datetime #include common.py sys.path.append('./common') import common #主函数的实现 if __name__ == "__main__": #入口参数:http://blog.csdn.net/intel80586/article/details/8545572 cmdPath = common.cur_file_dir() count = len(sys.argv) for i in range(1, count): print("参数", i, sys.argv[i]) if i == 1: cmdPath = sys.argv[i] common.SetCmdPath(cmdPath) # rootDir ="/Users/jaykie/sourcecode/cocos2dx/product/game/ertong" rootAndroidStudio = common.GetRootDirAndroidStudio() rootiOSXcode = common.GetRootDirXcode() rootCode = common.GetRootDir() + "/ios_code_unity_moon" # targetDir = rootiOSXcode + "/Classes" common.copyFiles(rootCode, targetDir) print "copy_ios_code sucess"
print("cmdPath=" + cmdPath + " count=" + str(count)) common.SetCmdPath(cmdPath) gameName = common.getGameName() gameType = common.getGameType() print("gameName=" + gameName) print("gameType=" + gameType) RootDir = common.GetRootProjectIos() target = "Unity-iPhone" ipa_file = RootDir + "/app/" + target isUploadIPA = False isExportIPA = False # 清空频道文件 channel_dir = common.GetRootDirXcode() + "/Data/Raw/channel" flag = os.path.exists(channel_dir) if flag: shutil.rmtree(channel_dir) if count > 1: argv1 = sys.argv[2] if argv1 == "upload_ipa": isUploadIPA = True # ipa_file = RootDir + "/app_export_ipa/" + target UploadOneIPA(ipa_file + "/" + target + ".ipa") if argv1 == "export_ipa": isExportIPA = True if count > 2: channel = sys.argv[2]