Missing languages on iOS simulator - ios

When I run my application, my iPhone/iPad simulator only gives me 6 language choices (English, German, Japanese, Italian, Spanish, and Hungarian). After having Googled this it seems like there should be at least 18 language choices available.
I've reinstalled Xcode 4.3.1, and installed the iOS 5.1 simulator, and it has the same issues, same languages.
Does anyone know where these languages are defined, and why a simulator wouldn't have all available options? Google and the Apple Dev forums are of no help.
Here's a screenshot:
Update: I decided to install the slightly older 5.0 simulator (instead of 5.1), and whenever I'm using the 5.0 simulator it appears I have all of the languages. If I switch back to the 5.1 simulator I still only have the 6 languages shown in the above screenshot.

I think something bad has happened to your simulator installation, not that Apple removed languages. If they were to cut down on the number of languages in the simulator to only 6 Magyar would be an odd choice (with only 12.5M or so speakers).
I also checked my Xcode 4.3.3/iPhone 5.1 simulator and I have what I assume the full complement of languages. Might be worth trying to reinstall your simulator!
The list of languages presented by the simulator in the Settings app can be found in
/Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/PrivateFrameworks/Preferences.framework/GlobalPreferences.plist.
It's in binary format so you would need to copy it away to a temp directory and use plutil -convert xml1 <file_name> to convert it to something you can read. You could check and see if the languages are missing from this list.
For reference here's what mine looks like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppleLanguages</key>
<array>
<string>en</string>
<string>fr</string>
<string>de</string>
<string>ja</string>
<string>nl</string>
<string>it</string>
<string>es</string>
<string>pt</string>
<string>pt-PT</string>
<string>da</string>
<string>fi</string>
<string>nb</string>
<string>sv</string>
<string>ko</string>
<string>zh-Hans</string>
<string>zh-Hant</string>
<string>ru</string>
<string>pl</string>
<string>tr</string>
<string>uk</string>
<string>ar</string>
<string>hr</string>
<string>cs</string>
<string>el</string>
<string>he</string>
<string>ro</string>
<string>sk</string>
<string>th</string>
<string>id</string>
<string>ms</string>
<string>en-GB</string>
<string>ca</string>
<string>hu</string>
<string>vi</string>
</array>
<key>AppleLocale</key>
<string>en_US</string>
</dict>
</plist>

Based on information in the answer posted the user named idz, located in this same question, I was able to figure out how to fix this.
I was using 5.1, I had to install the previous version of my simulator (5.0), then locate the language directories from 5.0 and copy them into the proper location for 5.1, and then restart the iPhone Simulator. Here are some detailed steps:
Locate the language .lproj directores for the 5.0 simulator. /Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/Preferences.framework/
Within this folder you will see many folders with the .lproj extension, e.g. English.lproj. Copy all of the .lproj folders that you find here.
Locate the folder with the .lproj directories for the 5.1 simulator. /Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/PrivateFrameworks/Preferences.framework/
Paste the folders you copied into this directory. I chose not to overwrite any existing folders when I did this.
Restart your iPhone Simulator.
Make sure your iPhone Simulator is set to 5.1. While the iPhone Simulator is selected, go to Hardware -> Version -> 5.1. Now when you go to choose the language for the simulator you should have all of the languages available that you copied over from the 5.0 folder.
Alternatively some have said that you might be able to fix this by simply uninstalling the Xcode SDK and reinstalling it, but I've found this way to be much faster.
I submitted a bug report to Apple for this, and after a week had no response. I've directed them to this page for the fix to the problem, but I'm still not sure how this happened in the first place.

Related

AIR iOS dysm/symbolicate file

Submitted an app to the iOS store yesterday and they threw me back some crash logs that happened on launch. All the shiny numbers in the log apparently mean something, but I can't find out how to translate them. According to old forum posts, I need a dysm or a symbolicate link file. However, the references that point to the solution seem to be expired. Looking throug the .ipa in Winrar, I see my strings files, extensions, icons and the like, but nothing that I can see relates to a .dysm. Where would I find this? To have it work fine in debug with a dev provision/certificate and then have it not with a iTunes release prov/cert leads me to believe it may be related to that, but I only had one testing device at the time so I am a bit worried.
Side Question: I was unable to install the ipa when I changed it from dev to release. This is normal though, since it doesn't have the testing device's uid in the provision, correct?
you can find .dysm:
open your app in xcode -> open products -> right click and show in finder(.app)
or
you must operate in computer which you archived.
I use Animate on Mac and the .dysm file is automatically produced when the .ipa is produced.
Typically a .dysm file is used along with the crash reports to isolate the symbol/object/function that has caused the crash. But it the case of AIR app this isn't workable.
https://forums.adobe.com/thread/1693126
To test your app before submitting to the App Store for approval you should upload it to TestFlight. This allows you to test a distribution build.
For you TestFlight compatible build you need to add a couple of nodes to you app-descriptor file.
<Entitlements>
<![CDATA[ <key>get-task-allow</key>
<false/>
<key>beta-reports-active</key>
<true/> ]]>
</Entitlements>
https://forums.adobe.com/thread/1652215
If your TestFlight app crashes you can access the device logs via Xcode to see what happened. Or build in some kind of trace output textfield into your app where you can output what is happening as your app loads. Similar to how you would use trace() in debug mode.

Can I change the Apple Watch simulator language?

Is it possible to change the Apple Watch simulator locale? I want to test the localization of my watch app. I can change language on an iPhone simulator, but the watch simulator is always in English. I can't find any language settings:
Most certainly not possible neither via Watch Simulator UI nor iOS Simulator Watch app, but you can copy over values from iOS Simulator folder located in:
<simulator_dev_folder>/data/Library/Preferences/.GlobalPreferences.plist
to the same file in your Watch Simulator.
Plist keys to look for:
AppleLocale
AppleLanguages
AppleKeyboards
You cannot change the Apple Watch simulator locale, but you can change the locale of your Watch App. I use this to test localization. To change your app locale, go edit the Watch App Scheme: Run->Options->Application Language - choose the language and re-run your Apple watch app.
Run|Options|Application Language
Unfortunately it works only on Xcode 7.2, not on Xcode 7.1. There is no other known possibility.
EDIT
There is a brand new library for language and locale automate testing. It's called AutoMate. The documentation can be found here.
I post my comment for a more readable format.
Hope that can be a "viable" work around
Create the different localization files: English, French, Spanish, Chinese…
localize all elements here
then, open the English files
copy the content of the language you want to test after the present english text (that will supersede it).
To come back to english, delete this added foreign text.
I tested, it works.
I just get an error log, without apparent consequence
Watch Extension[3520:334638] [default] -[SPRemoteInterface _interfaceControllerClientIDForControllerID:]:2140: ComF: clientIdentifier for interfaceControllerID:DC00003 not found
But that is good enough to test localization on simulator.
Removing the extra text clears the error.
I improved this answer.
https://stackoverflow.com/a/54883097/2519218
Change directory to your simulator devices. eg. /Users/$USER_NAME/Library/Developer/CoreSimulator/Devices
Detect your watch simulator. I used ls -trl command after build. eg. 046D5EDA-1808-4BE2-A16E-04DF0324B032
plutil -convert xml1 ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist -o change_global.plist
Edit change_global.plist AppLanguages's section you want to use by vim. I wanted to use ja, so it's like <key>AppleLanguages</key> <array> <string>ja</string> </array>.
Put change_global.plist to ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist. like cp change_global.plist ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist .
Restart simulator.
Unfortunately, it doesn't seem like you can change the language in the watch simulator at this time. On the device, it's located in the iPhone Watch app under General -> Language & Region. However, on the iPhone simulator, there isn't even an option for the General section. This is all that shows up under the Watch app:

Trigger.io: iOS 9 iPad Multitasking error

UPDATE: This problem is now solved by using the latest version of Trigger.io
This question is about how to get around the ITMS-90475 error using Trigger.io (and not xcode).
After the release of iOS 9, i get the following error when submitting an app to the App Store that is built using Trigger.io/Forge:
ERROR ITMS-90475: "Invalid Bundle. iPad Multitasking support requires launch story board in bundle
I am developing on linux, and not using xcode to upload my app. From other stackoverflow answers (e.g. this: https://stackoverflow.com/a/32563605/1030104) I see one solution is to disable multitasking support using xcode.
Does anyone know whether this is possible to do using only Trigger.io and not xcode?
According to this answer, your bundle should be valid if you deactivate multitasking for your app. Add this to your Info.plist:
<key>UIRequiresFullScreen</key>
<string>YES</string>
As you're using Trigger.io, this means you have to edit the Info.plist file in between forge build and forge package either programatically (as part of your build process) or by editing the file manually.
For your target, check Requires Full Screen on the General Page:
try adding the bellow code to the info.plist
<key>UIRequiresFullScreen</key>
<true/>

Xcode 5/iOS 7 - localization not working in simulator

I was following one of Ray Wenderlich's tutorials on localization but I can't seem to get it working.
I've set my project up for localization in English and French and I have a locaziable.strings file for each:
The French file has the correct (well as far as Google translate goes) French versions of my string:
I'm setting the strings by calling the correct key from the localizable.strings file:
NSString* strTitle = [NSString stringWithFormat:NSLocalizedString(#"Title", Nil)];
And I have the simulator set to French (BTW: Whenever I do a language change the simulator crashes).
But it is not pulling from the correct localizable.strings file. It's still displaying in English:
Am I doing something wrong?
If you are using xcode 6.1.1 and iOS sdk 8.1,try this workaround.
It seems localization does not work with xCode 6.1 and 8.1 simulator.
Workaround:
Go to "edit schemes" >> "Run" (side bar) >> "Options" tab >> "Application Language"
Select the language you wish to run the app on the simulator.
I got this workaround from Workaround by natanavra
Thanks to him.
However I read on developer forum,that it is working in 6.2 beta version of Xcode. Hope it do.
Maybe you have run the app at some time where the file Localizable.strings already existed but has not been localized yet. If this is the case, this unlocalized file still resides in the resources folder in the application bundle in the simulator (when you build an run a new version of your app in the simulator or in the device, unused files will not be deleted). This can lead to problems.
Try to delete the app completely from the simulator and build an run again.
I have experienced similar issues (IB localization in my case) on device. So general answer would be
Device - Uninstall app and clean project by Shift+CMD+K
Simulator - Go iOS simulator > Reset Content and Settings and clean project by Shift+CMD+K
These problems are really annoying. Along with poor ability to update localized strings is localization one of the biggest drawback of iOS development.
Another problem that could cause localization not work is the encoding of the strings file. Localizable.strings's encoding must be UTF-16. The default encoding of text file in xcode is UTF-8, that cause me spending a whole day to check why the localization not work.
In Xcode 6.0 and later, Localization not work by changing language in Simulator not working.
You have to edit scheme before running your application.
Go to Edit Scheme -> Run -> Options, change language here.
Now, Run Your Application. It will Work.
For more details, check this answer : Changing language on iOS 8.1 simulator does not work
My problem for this was an incorrectly encoded character in the localization file.

Missing AppIcon in Organiser

I've recently migrated my application to support iOS7 and during that process updated my app icons to use an Asset Catalog; which is all working great in the app. However, in Organizer—and TestFlight—my app icon is missing.
The same is also happening in TestFlight—which implies there is something missing from my bundle. Any help would be gratefully received.
So it seems you still need to have the Icon files entry in the app plist that points to an icon that is a resource in the app; even though Xcode removed this when I converted to the catalog; here is the entry that I created manually whilst also keeping the asset catalog:
Note that I have tested this with different icons and this setting does not impact the icons the App actually uses at runtime; this entry appears to only be used by Organizer and TestFlight, thereby solving my problem.
Yeah while using the Asset Catalog, you may need to do the following to get the App's Icon linked and working for Ad-Hoc distributions / production to be seen in Organiser, Test flight and possibly unknown AppStore locations.
After creating the Asset Catalog, take note of the name of the Launch Images and App Icon names listed in the .xassets in Xcode.
By Default this should be
AppIcon
LaunchImage
[To see this click on your .xassets folder/icon in Xcode.]
(this can be changed, so just take note of this variable for later)
What is created now each build is the following data structures in your .app:
For App Icons:
iPhone
AppIcon57x57.png (iPhone non retina) [Notice the Icon name prefix]
AppIcon57x57#2x.png (iPhone retina)
And the same format for each of the other icon resolutions.
iPad
AppIcon72x72~ipad.png (iPad non retina)
AppIcon72x72#2x~ipad.png (iPad retina)
(For iPad it is slightly different postfix)
Main Problem
Now I noticed that in my Info.plist in Xcode 5.0.1 it automatically attempted and failed to create a key for "Icon files (iOS 5)" after completing the creation of the Asset Catalog.
If it did create a reference successfully / this may have been patched by Apple or just worked, then all you have to do is review the image names to validate the format listed above.
Final Solution:
Add the following key to you main .plist
I suggest you open your main .plist with a external text editor such as TextWrangler rather than in Xcode to copy and paste the following key in.
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>AppIcon57x57#2x.png</string>
<string>AppIcon72x72~ipad.png</string>
<string>AppIcon72x72#2x~ipad.png</string>
</array>
</dict>
</dict>
Please Note I have only included my example resolutions, you will need to add them all.
If you want to add this Key in Xcode without an external editor, Use the following:
Icon files (iOS 5) - Dictionary
Primary Icon - Dictionary
Icon files - Array
Item 0 - String = AppIcon57x57.png
And for each other item / app icon.
Now when you finally archive your project the final .xcarchive payload .plist will now include the above stated icon locations to build and use.
Do not add the following to any .plist: Just an example of what Xcode will now generate for your final payload
<key>IconPaths</key>
<array>
<string>Applications/Example.app/AppIcon57x57.png</string>
<string>Applications/Example.app/AppIcon57x57#2x.png</string>
<string>Applications/Example.app/AppIcon72x72~ipad.png</string>
<string>Applications/Example.app/AppIcon72x72#2x~ipad.png</string>
</array>
Yet another possible hiccup with migrating to Asset Catalog.
There is two ways to define icons in project settings: CFBundleIconFiles since iOS3 and CFBundleIcons since iOS5. The older, despite being older, contrary to common sense about backward compatiblity, still takes precedence. I was using CFBundleIcons before migrating directly to Asset Catalog. And after i migrated, i removed the original files pointed to by CFBundleIcons because, you know, now i had the shiny new Asset Catalog, right? And XCode did three things:
it hides the visual editing of former CFBundleIcons from General project settings. Why would you need it when you already opted in for the shiny new Asset Catalog, right?
it does not remove the original CFBundleIcons key of Info.plist, though, by opting in for the Asset Catalog, you are saying clear and loud that you are not going below iOS5
it does not validate the said key either. No little red crossmarks anywhere, because the project settings UI which could display them, is not visible anymore
The result is hidden, visually noneditable, possibly outdated/wrong key in Info.plist which takes precedence over what Asset Catalog created for you.
Go open your Info.plist manually and delete CFBundleIcons, rebuild, reupload, and voilà, icon is back.

Resources