Meteor测试/部署iOS应用程序以连接真实服务器(不是localhost)

mau*_*lus 6 javascript node.js ios meteor

我有一个我在iOS手机上测试的流星应用程序.我最初使用以下内容部署了应用程序(基于本指南):

meteor install-sdk ios    
meteor add-platform ios
meteor run ios

meteor run ios-device
Run Code Online (Sandbox Code Playgroud)

但是,这只是使用托管的本地版本http://localhost:3000.所以,我一直在阅读有关如何部署到特定的服务器,检查一个数量不同指令网站的话题.从这看起来我应该简单地运行以下,http://example.com服务器位置在哪里:

meteor run ios-device --mobile-server http://example.com
Run Code Online (Sandbox Code Playgroud)

但是,应用程序仍在本地服务器上运行.在config.xml旁边有两行:

<access origin="http://meteor.local/*"/>
<access origin="*://example.com/*"/>
Run Code Online (Sandbox Code Playgroud)

所以我尝试删除<access origin="http://meteor.local/*"/>,但这没有解决它.

然后我mobile-config.js根据这个例子在一个名为的文件中将以下内容添加到我的meteor项目的根目录中,

App.info({
  name: 'Example',
  description: 'An iOS app built with Meteor',
  version: '0.0.1',
  author: 'Me',
  website: 'http://example.com/'
});

App.icons({
  // iOS
  'iphone': 'resources/icons/icon-60.png',
  'iphone_2x': 'resources/icons/icon-60@2x.png',
  'ipad': 'resources/icons/icon-76.png',
  'ipad_2x': 'resources/icons/icon-76@2x.png'
});

App.launchScreens({
  // iOS
  'iphone': 'resources/splash/Default~iphone.png',
  'iphone_2x': 'resources/splash/Default~iphone.png',
  'iphone5': 'resources/splash/Default-568h@2x~iphone.png',
  'ipad_portrait': 'resources/splash/Default-Portrait~ipad.png',
  'ipad_portrait_2x': 'resources/splash/Default-Portrait~ipad.png',
  'ipad_landscape': 'resources/splash/Default-Landscape~ipad.png',
  'ipad_landscape_2x': 'resources/splash/Default-Landscape@2x~ipad.png'
});

App.accessRule('example.com/*')
Run Code Online (Sandbox Code Playgroud)

应用程序编译,但它仍然在localhost上运行.此外,应用程序图标和屏幕spash是流星默认值,而不是我的自定义图标/闪屏(这是在根文件夹resources/econs/...pngresources/splash/...png,因此,或许在编译过程中忽略了一切,是在mobile-config.js

所以问题归结为"如何使用实时服务器运行这个iOS应用程序?"

Ant*_*ige 0

您可以构建应用程序以连接到生产服务器

meteor build /tmp/example-build --server=http://example.com

之后将其加载到您的设备上。