找不到 iPhone 模拟器生成的文件
在尝试找出 iPhone 模拟器存储文件的位置时,我使用 Speak Here 项目来录制我的声音并将其保存到文件中。由于模拟器能够播放录音,所以一定在某个地方有一个文件,但我不可能找到它。我已经尝试了一切,包括使用终端命令locate(使用sudo /usr/libexec/locate.updatedb之后)。有什么帮助吗?
My apologies if this is a duplicate to my previous question, but this is driving me a bit batty.
In trying to figure out where the iPhone Simulator is storing files I used the Speak Here project to record my voice and save it to a file. Since the simulator is able to playback the recording there must be a file somewhere, but it is impossible for me to find. I have tried everything including using the terminal command locate (after using sudo /usr/libexec/locate.updatedb). Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SpeakHere 应用程序将录制的文件存储在临时目录中。您可以使用以下代码找出路径及其内容:
在 iOS 模拟器中,此路径将类似于
/
var/folders/eQ/eQdXXQoxFHmxhq85pgNA+++++TI/-Tmp-/
但在设备上,这是应用程序目录中的子目录。例如/private/var/mobile/Applications/965A9EEF-7FBA-40F4-8A42-FE855A719D52/tmp/
。The SpeakHere app stores the recorded file in the temporary directory. You can find out the path and its contents with this code:
In the iOS Simulator this path will be something like
/
var/folders/eQ/eQdXXQoxFHmxhq85pgNA+++++TI/-Tmp-/
but on the device this is a subdirectory in your app dir. like/private/var/mobile/Applications/965A9EEF-7FBA-40F4-8A42-FE855A719D52/tmp/
.#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
-(void) startRecording
{
[自动停止播放];
}
-(void) 停止录音
{
NSLog(@"停止录音");
[录音机停止];
NSLog(@"已停止");
}
#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
-(void) startRecording
{
[self stopPlaying];
}
-(void) stopRecording
{
NSLog(@"stopRecording");
[audioRecorder stop];
NSLog(@"stopped");
}