简体   繁体   English

在 windows cmd 上运行 unix 命令

[英]Running unix commands on windows cmd

i am currently trying to learn how to develop apps for android mobile phones using PhoneGap.我目前正在尝试学习如何使用 PhoneGap 为 android 手机开发应用程序。 i was able to get this book titled "PhoneGap 2x mobile application development".我得到了一本名为“PhoneGap 2x 移动应用程序开发”的书。 ths book is really nice and self explanatory but the problem i have is when the author want to create d project via the command line, he was using Unix commands because he is running a Unix PC.这本书非常好而且不言自明,但我遇到的问题是,当作者想通过命令行创建 d 项目时,他使用的是 Unix 命令,因为他运行的是 Unix PC。 I am running Windows and to follow his commands using the CMD is a bit hard for me because i dont understand all of his commands.我正在运行 Windows 并且使用 CMD 遵循他的命令对我来说有点困难,因为我不理解他的所有命令。

Below was what he wrote:下面是他写的:

mkdir $PROJECT_HOME
cd $PROJECT_HOME
mkdir Android iOS www
cd $PHONEGAP_HOME/lib/android/bin
./create $PROJECT_HOME/Android/QuizTime com.phonegaphotshot.
QuizTime QuizTime
cd $PHONEGAP_HOME/lib/ios/bin
./create $PROJECT_HOME/iOS com.phonegaphotshot.QuizTime QuizTime
cd $PROJECT_HOME
mkdir www/cordova
cp Android/QuizTime/assets/www/cordova-2.2.0.js www/cordova/
cordova-2.2.0-android.js
cp iOS/www/cordova-2.2.0.js www/cordova/cordova-2.2.0-ios.js
cd Android/QuizTime/assets
rm –rf www
ln –s ../../../www
cd ../../../iOS
rm –rf www
ln -s ../www
cd ..
cd www
cp –r $YASMF_DOWNLOAD/framework .
mkdir images models views style
cd ..
cd Android/QuizTime/src/com/phonegaphotshot/QuizTime
edit QuizTime.java
Change "index.html" to "index_android.html"
Save the file.
cd $PROJECT_HOME/iOS/QuizTime

can someone tell me how to do this on the windows cmd.有人可以告诉我如何在 Windows cmd 上执行此操作。 i know what mkdir is but i need a total description and if possible a translation following that if you were to do this on a windows cmd.我知道 mkdir 是什么,但我需要一个完整的描述,如果可能的话,如果您要在 Windows cmd 上执行此操作,还需要翻译。

I forgot to mention one simple fact.我忘了提及一个简单的事实。 You CAN NOT RUN the unix commands over Windows DOS/CMD check this link.您无法通过 Windows DOS/CMD 运行 unix 命令,请检查此链接。 It gives direct co-relation between dos and unix commands.它给出了 dos 和 unix 命令之间的直接关联。 hope this helps.希望这可以帮助。 http://www.tldp.org/LDP/intro-linux/html/app2.html http://www.tldp.org/LDP/intro-linux/html/app2.html

or better still, check this http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html或者更好,检查这个http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html

Once you get the different commands, guess it should not be hard for you to write it in DOS.一旦你得到了不同的命令,猜想你在 DOS 中编写它应该不难。 Note: The "create" command is part of phonegap/cordova apis..注意:“create”命令是 phonegap/cordova apis 的一部分。

Also, check this link: http://docs.phonegap.com/en/2.1.0/guide_command-line_index.md.html另外,请检查此链接: http : //docs.phonegap.com/en/2.1.0/guide_command-line_index.md.html

Here is a snapshot of the code converted:这是转换后的代码的快照:

 -- make directory ---
 C:\> mkdir PROJECT_HOME
 -- go to the directory you created ---
 cd PROJECT_HOME
-- make directories inside ---
C:\PROJECT_HOME> mkdir Android
C:\PROJECT_HOME> mkdir iOS
C:\PROJECT_HOME> mkdir www
-- now navigate to the bin directory- ---
C:\PROJECT_HOME> cd \lib\android\bin
-- now you basically runn the create command, am hereby just putting in what you wrote ---
C:\PROJECt_HOME\lib\android\bin>create \PROJECT_HOME\Android\QuizTime com.phonegaphotshot.QuizTime QuizTime
----- do same for the ios------------
-------make dir for cordova -------
C:\PROJECT_HOME> cd www
C:\PROJECT_HOME\www> mkdir cordova
--then you have to copy the contents of one directory to another, to copy everyrthin in directory recursively, use xcopy-----------
C:\PROJECT_HOME> XCOPY Android\QuizTime\assets\www\cordova-2.2.0.js www\cordova\cordova-2.2.0-android.js

I know this is a quite old question but anyway, have you ever tried a terminal emulator?我知道这是一个很老的问题,但无论如何,你有没有试过终端模拟器? Try Console .试试控制台 It's a free terminal emulator for windows.它是一个免费的 Windows 终端模拟器。

and to get to know what a command does type并了解命令键入的内容

man <command>

in the terminal.在终端。

The book "PhoneGap 2x mobile application development" is quite old. 《PhoneGap 2x 移动应用开发》这本书已经很老了。 The phonegap/cordova development has changed quite a bit from 3x onwards.从 3 倍开始,phonegap/cordova 的开发已经发生了很大的变化。 The current/latest version is 4x.当前/最新版本是 4x。

Below are the links pertaining to phonegap/cordova 3x which will work for 3x and 4x versions.以下是与 phonegap/cordova 3x 相关的链接,它们适用于 3x 和 4x 版本。

hope it helps.希望能帮助到你。

http://thejackalofjavascript.com/phonegap-3-cli-setup-mac-windows/ http://thejackalofjavascript.com/phonegap-3-cli-setup-mac-windows/

http://coenraets.org/blog/cordova-phonegap-3-tutorial/ http://coenraets.org/blog/cordova-phonegap-3-tutorial/

http://teusink.blogspot.in/2013/07/guide-phonegap-3-android-windows.html http://teusink.blogspot.in/2013/07/guide-phonegap-3-android-windows.html

http://sdk.revmobmobileadnetwork.com/phonegap_cordova.html http://sdk.revmobmobileadnetwork.com/phonegap_cordova.html

http://docs.phonegap.com/en/3.5.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide http://docs.phonegap.com/en/3.5.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide

Phonegap Cordova installation Windows Phonegap Cordova 安装 Windows

如果您安装 Cygwin,您可以在 Windows CMD 上使用 unix 命令,如您在本网站上看到的https://lifehacker.com/362316/use-unix-commands-in-windows-built-in-command-prompt

Actually, it is possible to run UNIX commands on Windows.实际上,可以在 Windows 上运行 UNIX 命令。 Have a look at all of the UNIX commands compiled for Windows in this GitHub repository: https://github.com/George-Ogden/UNIX在此 GitHub 存储库中查看为 Windows 编译的所有 UNIX 命令: https : //github.com/George-Ogden/UNIX

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM