想写一个 mac app , 把 php 脚本上传到我的 vps.
能不能在 mac app 中调用 shell 脚本, 然用 sshpass scp 实现?

想写一个 mac app , 把 php 脚本上传到我的 vps.
能不能在 mac app 中调用 shell 脚本, 然用 sshpass scp 实现?
1 matsuijurina Aug 25, 2015 可以的, mac app 的发挥空间比 ios 的还是大很多。 用 NSTask , 参考这篇 http://www.raywenderlich.com/36537/nstask-tutorial |
2 cxq OP @matsuijurina 谢谢 非常有用 |
3 djyde Aug 25, 2015 为啥不用 Git |
4 cxq OP @djyde 跟版本管理没关系, 我是写的一个根据,接口文档生成 php 脚本,然后自动传到 vps 的 mac app 。 偶尔用一下方便团队人生成假数据的。 |
5 honeycomb Aug 25, 2015 @matsuijurina AppStore 的沙盘软件也行吗? |
6 SwiftSandbox Aug 25, 2015 To read Mac app command line arguments: NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults]; NSString *strArg = [standardDefaults stringForKey:@"str"]; NSInteger intArg = [standardDefaults integerForKey:@"x"]; // Examples: here is command line with app and two parameters yourApp -str "StringArg" -x 99 |
| div class="fr"> 7 cxq OP @SwiftSandbox 谢谢 你是在哪里找到的资料呢? |
8 SwiftSandbox Aug 26, 2015 Enter the code inside a Mac app and you can read the command line parameters. Is that what you are looking for help with? |
9 cxq OP @SwiftSandbox Yes, thanks. |