美文网首页
RN-ios打包步骤

RN-ios打包步骤

作者: Mickqingzhou | 来源:发表于2018-05-29 18:50 被阅读53次

第一步 :

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
  NSURL *jsCodeLocation;
#ifdef DEBUG

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
//  jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];

#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"index.ios" withExtension:@"jsbundle"];
#endif

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
        moduleName:@"qqgl2    initialProperties:nil  launchOptions:launchOptions];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  // 启动图片延时: 1秒
  [NSThread sleepForTimeInterval:2];
  return YES;
}

第二步:

打开终端,进入你的rn工程,在根目录下执行bundle命令,指定到rn项目的ios工程文件夹下,记得一定要先创建bundle文件夹,不然终端会报文件夹找不到的错误, assets文件夹的路径不需要手动创建

$   react-native bundle --entry-file ./index.js --bundle-output ./ios/bundle/index.ios.jsbundle --platform ios --assets-dest ./ios/bundle --dev false
参考摘要

https://blog.csdn.net/sinat_34380438/article/details/76614309

相关文章

  • RN-ios打包步骤

    第一步 : AppDelegate.m 第二步: 打开终端,进入你的rn工程,在根目录下执行bundle命令,指定...

  • RN-iOS打包真机测试

    网上也有不少教程,我这里只是自己做个记录,此处不行再去网上找寻 第一步,终端cd到项目目录,执行命令 react-...

  • iOS Xcode打包ipa

    参考文档: Xcode打包ipa的基本步骤Xcode打包ipa的步骤(简述) 总结: 1、要想打包能安装的ipa包...

  • 呈上一份你最需要的iOS打包脚本!

    ios 打包步骤相对于 Android 来说稍显麻烦,先看一下在 Xcode 上打包的流程: Xcode 打包步骤...

  • iOS打包发布流程

    IOS苹果APP打包和上线步骤 苹果APP打包和上线步骤: 点击钥匙串创建证书(创建步骤如下); 在钥匙串打开之后...

  • React Native 真机打包

    React Native 真机打包 离线包不适合真机调试android 打包ios 打包 Android 打包步骤...

  • iOS10 app上线打包步骤

    步骤1: 步骤2: 步骤3: 步骤4: 步骤5: 步骤6: 步骤7: 步骤8: 打包成功后,利用 登录App St...

  • ReactNative-打包发布APK

    整体思路 通过Android Studio工具来实现签名和打包,步骤同原生开发,减少踩坑! 打包步骤 AS引入Re...

  • iOS开发程序打包为.ipa文件以及提交更新版本到App Sto

    程序打包成.ipa文件步骤 以及上传到app store上 1 >> 打包.ipa文件步骤 1 > 在选择模拟器那...

  • RN-iOS真机、打包运行 No bundle URL pres

    首先,按照 这篇文章进行打包,安装到真机上就出现上图错误 网上找到解决方法 需要将文件copy到bundle里面,...

网友评论

      本文标题:RN-ios打包步骤

      本文链接:https://www.haomeiwen.com/subject/jawajftx.html