xcode 如何在 iOS 6 模拟器中自定义运营商名称?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12580694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:37:36  来源:igfitidea点击:

How to customize carrier name in iOS 6 simulator?

iosxcodeios-simulatorios6xcode4.5

提问by ohho

How can I customize the default Carriername to something else, e.g. AT&T?

如何将默认Carrier名称自定义为其他名称,例如AT&T

回答by KrauseFx

There is a way to change the carrier name without using any objective c code or image editor app: https://github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName

有一种方法可以在不使用任何客观的 c 代码或图像编辑器应用程序的情况下更改运营商名称:https: //github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName

This solution works great with all versions of iOS (including iOS 6 and 7)

此解决方案适用于所有版本的 iOS(包括 iOS 6 和 7)

The key point is

关键是

sudo plutil -convert xml1 SpringBoard.strings

sudo plutil -convert xml1 SpringBoard.strings

We don't necessarily have to convert it back to binary code since Mac OS accepts both formats.

我们不必将其转换回二进制代码,因为 Mac OS 接受这两种格式。

After you converted your file to XML, you can easily edit the file with vim or any other editor of your choice.

将文件转换为 XML 后,您可以使用 vim 或您选择的任何其他编辑器轻松编辑该文件。

UPDATE: I uploaded a detailed description on how to update the carrier name: https://github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName

更新:我上传了关于如何更新运营商名称的详细说明:https: //github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName

回答by Anson

Copy and paste into terminal, replacing DERP with your carrier string:

复制并粘贴到终端中,用您的运营商字符串替换 DERP:

find -E /Applications/Xcode.app -iregex '.*/en(glish)?.lproj/SpringBoard.strings' -exec sudo /usr/libexec/PlistBuddy -c 'Set :SIMULATOR_CARRIER_STRING DERP' {} \;

find -E /Applications/Xcode.app -iregex '.*/en(glish)?.lproj/SpringBoard.strings' -exec sudo /usr/libexec/PlistBuddy -c 'Set :SIMULATOR_CARRIER_STRING DERP' {} \;

Finds relevant files and modifies them in place. No copying files, converting binary to xml, or editing strings in other applications.

查找相关文件并就地修改它们。无需复制文件、将二进制文件转换为 xml 文件或在其他应用程序中编辑字符串。

回答by ArtFeel

You can use this hack, just compile the XCDFakeCarrier.mfile in your project and change the FakeCarrierconstant to what you want.

您可以使用此 hack,只需XCDFakeCarrier.m在您的项目中编译文件并将FakeCarrier常量更改为您想要的。

回答by Fogmeister

There is a perfect app for this called Status Magic that I was beta testing. Just trying to find a link for it...

有一个完美的应用程序,称为 Status Magic,我正在进行 Beta 测试。只是想找到它的链接...

You import a screenshot and it removes all the carrier specific text from it and replaces it with a standard status bar and you can edit the time, carrier info, etc...

您导入屏幕截图,它会从中删除所有运营商特定文本并将其替换为标准状态栏,您可以编辑时间、运营商信息等...

Means you don't have to use Photoshop or anything.

这意味着您不必使用 Photoshop 或任何东西。

Will be back with a link...

将返回一个链接...

LINKhttps://itunes.apple.com/uk/app/status-magic/id547920381?mt=12

链接https://itunes.apple.com/uk/app/status-magic/id547920381?mt=12

EDITJust found out that the app is still in review fro the Mac App Store. Should be out soon. It really is perfect for what you are wanting to do though. And really easy to use.

编辑刚刚发现该应用程序仍在 Mac App Store 中进行审核。应该很快就出来了。不过,它确实非常适合您想要做的事情。而且真的很容易使用。

回答by Fahri Azimov

I don't know if that's possible with iOS Simulator (If it's even possible you have to dig deep :) ). The best way is to take the screenshot (Command+S), and change the image in Adobe Photoshop, or some image processing program like that.

我不知道 iOS 模拟器是否可行(如果有可能,您必须深入挖掘 :))。最好的方法是截取屏幕截图(Command+S),然后在 Adob​​e Photoshop 或类似的图像处理程序中更改图像。