Skip to content

Instantly share code, notes, and snippets.

@tkoki
Last active December 21, 2015 06:59
Show Gist options
  • Save tkoki/6267745 to your computer and use it in GitHub Desktop.
Save tkoki/6267745 to your computer and use it in GitHub Desktop.
iPhone simulator内からホストコンピュータ上のopenコマンドを叩く。この例ではiPhone simulator内のアプリの/tmpディレクトリ内にあるpngファイルをホストコンピュータ上のpngに関連付けられたアプリ(デフォルトではPreview.app)で開く。画像を生成するアプリのテストに重宝する。
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/open" arguments:[NSArray arrayWithObject:[NSString stringWithFormat:@"/tmp/%@.png", filename]]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment