MAC App 开发, 能不能运行 mac 本地的脚本? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
cxq
V2EX    iDev

MAC App 开发, 能不能运行 mac 本地的脚本?

  •  
  •   cxq 2015-08-25 11:17:46 +08:00 3951 次点击
    这是一个创建于 3705 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想写一个 mac app , 把 php 脚本上传到我的 vps.

    能不能在 mac app 中调用 shell 脚本, 然用 sshpass scp 实现?

    第 1 条附言    2015-08-25 17:39:34 +08:00
    另外纯属好奇, 怎么能让自己的 Mac App 接受命令行参数呢?
    9 条回复    2015-08-27 20:35:40 +08:00
    matsuijurina
        1
    matsuijurina  
       2015-08-25 12:00:01 +08:00   1
    可以的, mac app 的发挥空间比 ios 的还是大很多。 用 NSTask , 参考这篇 http://www.raywenderlich.com/36537/nstask-tutorial
    cxq
        2
    cxq  
    OP
       2015-08-25 13:26:20 +08:00 via iPhone
    @matsuijurina 谢谢 非常有用
    djyde
        3
    djyde  
       2015-08-25 13:54:41 +08:00
    为啥不用 Git
    cxq
        4
    cxq  
    OP
       2015-08-25 17:33:54 +08:00
    @djyde 跟版本管理没关系, 我是写的一个根据,接口文档生成 php 脚本,然后自动传到 vps 的 mac app 。 偶尔用一下方便团队人生成假数据的。
    honeycomb
        5
    honeycomb  
       2015-08-25 17:40:21 +08:00
    @matsuijurina AppStore 的沙盘软件也行吗?
    SwiftSandbox
        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
    cxq
        7
    cxq  
    OP
       2015-08-26 06:16:26 +08:00
    @SwiftSandbox 谢谢 你是在哪里找到的资料呢?
    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?
    cxq
        9
    cxq  
    OP
       2015-08-27 20:35:40 +08:00
    @SwiftSandbox Yes, thanks.
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1376 人在线/strong>   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 25ms UTC 17:02 PVG 01:02 LAX 10:02 JFK 13:02
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86