facebook twitter hatena line email

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

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(プレビュー)
(monaca本体のupdate)
行35: 行35:
 
  3.3.2
 
  3.3.2
  
  > monaca preview      => Run app in the browser
 
  > monaca debug        => Run app in the device using Monaca Debugger
 
 
   > monaca remote build => Start remote build for iOS/Android/Windows
 
   > monaca remote build => Start remote build for iOS/Android/Windows
  > monaca upload      => Upload this project to Monaca Cloud IDE
 
  
monaca update
+
==プロジェクトアップロード==
 +
以下で差分があれば全uploadされる
 +
monaca upload
  
 
==デバッグ==
 
==デバッグ==

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

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
 > monaca remote build => Start remote build for iOS/Android/Windows

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

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

monaca upload

デバッグ

monaca debug

webkitがないエラーが出たら

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

Node Webkit is not installed

以下コマンドを実行

npm install nw@0.26.6