How to launch iOS Simulator in specific language from command line?

后端 未结 3 1390
自闭症患者
自闭症患者 2020-12-19 07:54

I need to lauch iOS Simulator that uses specific language using command line. So I found that I can use

instruments -w 

and i

相关标签:
3条回答
  • 2020-12-19 08:21

    To run your app must be installed and located (if not, will open default language)

    Use this command to run your app with some language

    xcrun simctl launch <deviceid> <appid> -AppleLanguages "(pt-BR)"
    

    Sample:

    xcodebuild -sdk iphonesimulator8.4 -arch i386 install DSTROOT=SomeFolder
    xcrun instruments -w "iPhone 6 (8.4 Simulator)"
    xcrun simctl install booted SomeFolder/Applications/YourApp.app
    xcrun simctl launch booted com.yourdomain.yourapp -AppleLanguages "(pt-BR)"
    
    0 讨论(0)
  • 2020-12-19 08:21

    Have a look at:

    https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html Search for "Testing Specific Languages and Regions"

    Perhaps it could also be a solution creating different targets. Each target has configured another language

    0 讨论(0)
  • 2020-12-19 08:37

    The only way to launch iOS Simulator with specific language is to change contents of its .GlobalPreferences.plist file. Using xcrun tool will not work because it passess arguments to launched app and not changing language of simulator itself. Manipulation on .GlobalPreferences.plist is quite difficult because it is a binary plist file, so you cannot modify it as 'normal' xml. The easiest way to change its contents is to write simple Xcode Command Line Tool application, Foundation SDK has all tools needed to modify binary plists.

    0 讨论(0)
提交回复
热议问题