【问题标题】:How to find the device path in mac (iPhone)?如何在mac(iPhone)中找到设备路径?
【发布时间】:2012-09-11 14:25:41
【问题描述】:

我正在使用 iPhone 应用程序,我已经从 Dropbox 下载了一个文件来存储 iPhone 设备路径,例如"/Users/govindarajk/Library/Application Support/iPhone Simulator/5.1/Applications/343cc44-024DF2-34qs34-4433243-csafsa42232/Documents/Example.txt",但是我在我的 Mac 中检查了这个路径,路径文件没有显示它,如何找到这个路径和示例.txt 文件?请帮帮我

提前致谢

我必须以这种方式存储文件:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents directory
    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Example.txt"];
    NSError *error;

    [self.restClient loadFile:@"/example/Example.txt" intoPath:filePath];

    if (filePath) { // check if file exists - if so load it:
        NSString *tempTextOut = [NSString stringWithContentsOfFile:filePath
                                                          encoding:NSUTF8StringEncoding
                                                             error:&error];
    }

截图供参考:

User/govindaraj/Library,此处未显示的库文件:

【问题讨论】:

    标签: iphone ios file device


    【解决方案1】:

    Library 目录是隐藏的,您可以通过以下操作进入该目录: 在取景器中按 ⇧ Shift++G。 然后会弹出一个对话框,要求打开一个目录,只需输入~/Library,它应该会打开库目录。

    【讨论】:

    • 感谢您的回复,我试过了,但找不到文件夹
    • 抱歉在 / 中打错字(不应该是 \ 而是 / )
    • 见上文,我附上了屏幕截图供您参考。
    • 查看我对 / 和 \ 的评论,再次抱歉,我打错了。
    • 这个/和\我都试过了,但是同样的错误出现在file not be found
    【解决方案2】:

    打开终端并输入以下内容

    defaults write com.apple.Finder AppleShowAllFiles YES
    

    然后从 Apple 菜单上的强制退出选项重新启动 Finder。

    如果你想重新打开隐藏文件,命令是

    defaults write com.apple.Finder AppleShowAllFiles NO
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多