LoginSignup
2
1

More than 5 years have passed since last update.

macOSでNaitiveScriptの環境構築!困ったとこ覚書

Last updated at Posted at 2018-06-02

詰まったところの覚書

基本的には次のリンクのコードをコピペ
https://docs.nativescript.org/start/quick-setup#macos

コードは⬇️  

ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"

いくつか質問に答えて、うまくいったようにみえるけど、
エミュレーターが起動しない。

Android Emulators (AVD)がうまくはいっていないらしい。

エラーコードはこんな感じ。

Warning: File /Users/homepc/.android/repositories.cfg could not be loaded.
Warning: Failed to find package system-images;android-25;default;x86
WARNING: There seem to be some problems with the Android configuration

で、いろいろ調べたところ次の記事通りやればうまくいった。

macOSでAndroidエミュレータを起動する

「必要なパッケージのインストール」から「エミュレータの起動」まで参考リンクどうりにやってエミュレータが起動すれば、、

tns run android

でエミュレーターが動く!!!

@matyapiro31 さん ありがとうございました。。。

これでエミュレータがtnsコマンドから起動することができました。

ただし、またアプリがインストールされません。
エラーコード

Unable to apply changes on device: emulator-5554. Error is: The package manager service found that the device didn't have enough storage space to install the app..

アプリをインストールするスペースがないようです。。。
NaitiveScriptはWebpack入れなとアプリサイズが150MBになるので、
大きいアプリをインストールさせる設定が別に必要のようです。

(ちなみに、Webpackを入れると簡単なアプリは10MBくらいになった気がします)

How to increase storage for Android Emulator?

私は真ん中あたりのOn Android Studiosの見出しがある、
Android Studiosをそのままやってうまくいきました。

いろいろ方法はあるようですが、
GUIで操作できるのでこれが一番楽でした。

ということで
できた環境でandroid,iosの二つとも開いて
試してみました。(用意されているサンプルの中で一番重そうなやつ)

荒いGIF、
コードを変えているところを写し忘れたのでわかりにくいですが、
結構反映するのは早いです。
tns and ios twin.mov.gif

2
1
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
2
1