想写一个 mac app , 把 php 脚本上传到我的 vps.
能不能在 mac app 中调用 shell 脚本, 然用 sshpass scp 实现?
![]() | 1 matsuijurina 2015-08-25 12:00:01 +08:00 ![]() 可以的, mac app 的发挥空间比 ios 的还是大很多。 用 NSTask , 参考这篇 http://www.raywenderlich.com/36537/nstask-tutorial |
![]() | 2 cxq OP @matsuijurina 谢谢 非常有用 |
![]() | 3 djyde 2015-08-25 13:54:41 +08:00 为啥不用 Git |
![]() | 4 cxq OP @djyde 跟版本管理没关系, 我是写的一个根据,接口文档生成 php 脚本,然后自动传到 vps 的 mac app 。 偶尔用一下方便团队人生成假数据的。 |
5 honeycomb 2015-08-25 17:40:21 +08:00 @matsuijurina AppStore 的沙盘软件也行吗? |
![]() | 6 SwiftSandbox 2015-08-25 22:23:15 +08:00 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 |
![]() | 7 cxq OP @SwiftSandbox 谢谢 你是在哪里找到的资料呢? |
![]() | 8 SwiftSandbox 2015-08-26 08:15:09 +08:00 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. |