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 · Aug 25, 2015 · 4721 views
    This topic created in 4097 days ago, the information mentioned may be changed or developed.

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

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

    Supplement 1  ·  Aug 25, 2015
    另外纯属好奇, 怎么能让自己的 Mac App 接受命令行参数呢?
    9 replies  •  2015-08-27 20:35:40 +08:00
    matsuijurina
    matsuijurina
    Aug 25, 2015❤️1
    1
    可以的, mac app 的发挥空间比 ios 的还是大很多。 用 NSTask , 参考这篇 http://www.raywenderlich.com/36537/nstask-tutorial
    cxq
    cxq
    OP
    Aug 25, 2015 via iPhone
    2
    @matsuijurina 谢谢 非常有用
    djyde
    djyde
    Aug 25, 2015
    3
    为啥不用 Git
    cxq
    cxq
    OP
    Aug 25, 2015
    4
    @djyde 跟版本管理没关系, 我是写的一个根据,接口文档生成 php 脚本,然后自动传到 vps 的 mac app 。 偶尔用一下方便团队人生成假数据的。
    honeycomb
    honeycomb
    Aug 25, 2015
    5
    @matsuijurina AppStore 的沙盘软件也行吗?
    SwiftSandbox
    SwiftSandbox
    Aug 25, 2015
    6
    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
    cxq
    OP
    Aug 26, 2015
    7
    @SwiftSandbox 谢谢 你是在哪里找到的资料呢?
    SwiftSandbox
    SwiftSandbox
    Aug 26, 2015
    8
    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
    cxq
    OP
    Aug 27, 2015
    9
    @SwiftSandbox Yes, thanks.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2025 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 15:23 · PVG 23:23 · LAX 07:23 · JFK 10:23
    ♥ Do have faith in what you're doing.