facebook twitter hatena line email

「Monaca/コマンド」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(デバッグ)
(デバッグ)
行41: 行41:
 
==デバッグ==
 
==デバッグ==
 
  monaca debug
 
  monaca debug
 +
 +
以下でブラウザアクセス
 +
10.0.1.21:8001
  
 
==リモードビルド==
 
==リモードビルド==

2020年5月20日 (水) 18:21時点における版

CLIでの操作

公式マニュアル

https://docs.monaca.io/ja/products_guide/monaca_cli/cli_commands/

セットアップとログインとインポート

npm i -g monaca
monaca login
monaca import

プレビュー

monaca preview

以下エラーが出たらupdateする Project preview failed: Your project was created using Monaca CLI 2.x so you need to update your project ('monaca update') or downgrading your Monaca CLI version to 2.x.

以下URLとかでプラウザが起動する

ttp://localhost:8080/

プレビュー時のエラー

Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-GBZpdGLls8='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

www/index.html

修正前

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">

修正後

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">

参考:https://github.com/phonegap/phonegap-app-desktop/issues/801

monaca本体のupdate

monaca update
monaca version
3.3.2

プロジェクトアップロード

以下で差分があれば全uploadされる

monaca upload

デバッグ

monaca debug

以下でブラウザアクセス

10.0.1.21:8001

リモードビルド

monaca remote build

色々なビルドができる

 $ monaca remote build ios
 $ monaca remote build ios --build-type=debug
 $ monaca remote build android --build-type=debug --android_webview=crosswalk --android_arch=arm
 $ monaca remote build pwa --build-type=release
 $ monaca remote build electron_windows
 $ monaca remote build electron_macos
 $ monaca remote build electron_linux
 $ monaca remote build --browser
 $ monaca remote build --build-list
 $ monaca remote build android --skipUpload
 $ monaca remote build --browser --skipTranspile

webkitがないエラーが出たら

以下のようなwebkitがないエラーが出たら

Node Webkit is not installed

以下コマンドを実行

npm install nw@0.26.6