我可以在Xcode iOS Simulator中添加音乐库吗? [英] Can I add a music library to the Xcode iOS Simulator?

查看:71
本文介绍了我可以在Xcode iOS Simulator中添加音乐库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为iPhone和iPad创建音乐播放器. 我可以在iPhone和iPad上完美运行,因为它们实际上具有音乐库.但是我想在测试中使用fastlane和其他一些工具,因此我还需要能够在模拟器中查看/添加音乐库.

I'm trying to create a music player for iPhone and iPad. I get it working perfectly on my iPhone and iPad because those actually have a music library. However I want to use fastlane and some other tools with tests so I need to be able to see/add a music library to my simulator as well.

我已经导航到我的模拟器文件夹. /Users/maikohermans/Library/Developer/CoreSimulator/Devices/8A14CCDB../Data
但是我不知道去哪里看,甚至不应该去这里添加音乐.

I've navigated to my emulator folder. /Users/maikohermans/Library/Developer/CoreSimulator/Devices/8A14CCDB../Data
However I have no clue where to look and if I even should look here to add the music.

我希望有人可以在此帮助我.我已经搜索过了,但似乎很长一段时间都没有人问过这个问题.因此,这意味着要么所有人都放弃了它,要么有可能,而我似乎无法弄清楚如何做到这一点.

I hope someone can help me out here on how to do this. I've searched this but it seems like nobody asked this question for quite some time. So that means either everyone has given up on it or it is possible and I just can't seem to figure out how to do this.

推荐答案

尽管经常相信这是不可能完成的,但由于提到了@BaSha链接,我想出了办法.

Although the regular believe is that this can't be done I figured out how to do it thanks to the link @BaSha mentioned.

我写了一些如何,这样,每个面临相同问题或认为不可能的人都可以使它正常工作.

I wrote a little How To on it so everyone who faces the same problem or thinks it isn't possible will be able to get it working.

要给出要点,您将需要做些事情.

To give the gist of it you will need a few things.

  1. 实际上带有音乐的iOS设备
  2. iFunBox或类似的东西
  3. 您要使用的模拟器的ID

要获取要测试的设备的ID,可以运行

To get the id of the device you want to test on you can run

xcrun simctl list

这将为您提供所有可用模拟器的列表,选择您要使用的模拟器并复制ID,您将需要它.

This will give you a list of all the available simulators, pick the one you want to use and copy the id, you will need this.

现在导航到您刚刚选择的模拟器的目录.

Now navigate to the directory of the simulator you just chose.

[yourHD]->用户-> [您的用户名]->库->开发人员-> CoreSimulator->设备-> [您在上一步中获得的ID]->数据->媒体-> iTunes_Control-> iTunes

[yourHD] -> Users -> [yourusername] -> Library -> Developer -> CoreSimulator -> Devices -> [the ID you obtained in the previous step] -> data -> Media -> iTunes_Control -> iTunes

现在,您必须打开iFunBox(将带有音乐库的手机连接到PC).在iFunBox中,选择Raw File System.在此目录中,您将找到一个名为iTunes_Control的目录,您需要将一些文件和目录复制到之前打开的模拟器目录中.即:

Now you have to open iFunBox (connect your phone with music library to your pc). In iFunBox, select Raw File System. In this you will find a directory called iTunes_Control from that directory you need to copy some files and directories to the simulator directory you opened before. namely:

Music
iTunes/Artwork
iTunes/MediaLibrary.sqlitedb
iTunes/MediaLibrary.sqlitedb-shm
iTunes/MediaLibrary.sqlitedb-wal

如果您曾经购买过音乐,还应该获取以下目录Raw File System/Purchases

If you ever bought music you should also grab the following directory Raw File System/Purchases

这篇关于我可以在Xcode iOS Simulator中添加音乐库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆