1.使用cocos導(dǎo)出iOS工程的時(shí)候
發(fā)布平臺 選擇Android
模板 選擇default
APP ABI 勾選 armeabi-v7a
唤锉、arm64-v8a
2.導(dǎo)出的iOS工程在蘋果電腦上打開后溢十,將項(xiàng)目設(shè)置成自動內(nèi)存管理模式
1.在項(xiàng)目->Target->Build Setting Apple Clang - Language - Objective-C
下面的選項(xiàng)中設(shè)置為 YES
2.把a(bǔ)pp->ios 目錄下
main.m
中的代碼換成自動內(nèi)存管理模式寫法
//修改前
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return retVal;
}
//修改后
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSString * appDelegateClassName;
@autoreleasepool {
appDelegateClassName = @"AppController";
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}
3.把 app->ios 目錄下 AppController.mm
中 - (void)applicationWillTerminate:(UIApplication *)application
做相應(yīng)的調(diào)整
//修改前
- (void)applicationWillTerminate:(UIApplication *)application{
[[SDKWrapper getInstance] applicationWillTerminate:application];
delete app;
app = nil;
}
//修改后
- (void)applicationWillTerminate:(UIApplication *)application{
[[SDKWrapper getInstance] applicationWillTerminate:application];
//delete app;
app = nil;
}
3.如果游戲進(jìn)入后臺 然后殺死進(jìn)程 bug 跟蹤平臺會收到報(bào)錯(cuò)日志需要把下面的代碼注釋了
4.如果游戲使用到了cocoapods 下載第三方的SDK庫,需要在App->Project->info
需改前
需改后
5.游戲上線的時(shí)候設(shè)置 Bitcode 為false
6.設(shè)置info.plist 中的一些信息
AppleId
App Transport Security Settings
Privacy - Camera Usage Description
Privacy - Location Always and When In Use Usage Description
Privacy - Location Always Usage Description
Privacy - Location Usage Description
Privacy - Location When In Use Usage Description
Privacy - Photo Library Usage Description