10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

React Nativeで作ったアプリをVisual Studio Mobile Centerで配布する

Last updated at Posted at 2017-01-20

Visual Studio Mobile Centerを使ってReact Nativeアプリを配布する方法を説明します。

配布用のアプリを用意する

$ react-native init RNDemoApp
$ cd RNDemoApp
$ git init
$ git add .
$ git commit -m "Bootstrap React Native project"

GitHubに新規リポジトリを作成してローカルで作ったコードをプッシュする。

// 自分で作成したリポジトリに置き換えてください
$ git remote add origin git@github.com:mkamakura/RNDemoApp.git
$ git push -u origin master

Visual Studio Mobile Centerに配布するアプリを登録する

https://mobile.azure.com/login にアクセスしてGitHubアカウントでログインします。
ログインしたらAdd a new appボタンを押してアプリを追加します。

image

AndroidもAndroid-RNDemoAppという名前で作成しました。

ビルド設定をする

まずMobile Centerに登録したAppにGitHubに作成したリポジトリを紐付けます。

Mobile CenterのサイドメニューにあるBuildから先程作成したリポジトリを選択します。(iOSAndroidそれぞれ実行する必要があります)

image

iOSのビルド設定

$ open ios/RNDemoApp.xcodeproj

image

image

Product>Scheme>Edit Scheme...を開いてBuild ConfigurationReleaseにする
image

RNDemoAppTestsの項目のチェックボックスを外す
image

XCodeを閉じて変更をCommit&Pushする。

$ git add .
$ git commit -m "Add iOS Signing Info"
$ git push origin master

Mobile Centerからアプリのbranch設定をします。

image

iOSのビルド設定が完了すると、自動的にビルドが実行されます。

Androidのビルド設定

$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

terminalからkeystoreを作成して、Mobile CenterのAndroidアプリのbranch設定をします。

image

セットアップが完了するとビルドが実行されます。
image

実機での確認

ビルドが成功するとインストールのリンクが貼られたメールが届きます。
image

インストールが完了したらアプリを起動して、動作を確認しましょう。
image

キャプチャはiPhoneの画面ですが、流れはAndroidも同じです。

参考

この記事は以下の動画を参考に作成しました。不明な点がある場合は動画も参考にしてください。
https://www.youtube.com/watch?v=lfqZ8Uy2p3U

10
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?