Showing posts with label Xcode. Show all posts
Showing posts with label Xcode. Show all posts

Monday, December 7, 2020

Xcode 12 - Could not find module for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64


1. Select Target , and choose Build Settings tab, At the bottom, you will fond 'User-Defined' section, add " x86_64 i386" values to the VALID_ARCHS















2. Build Settings tab, Search 'Architecture' to see the 'Architecture' section, set 'Yes' for the key 'Build Active Architecture Only'













Thanks for reading.

Monday, April 27, 2020

iOS - CICD Automate Test Flight submission using GitHb Actions



From 2019, GitHub introduced GotHub actions.

So without any third party we are able to automate our deployment process for our private and public git repositories.

We can create workflow (a yml file) to trigger when push to specific branch etc...

This https://engineering.talkdesk.com/test-and-deploy-an-ios-app-with-github-actions-44de9a7dcef6 is a very good tutorial for do this process.

By adding .yml workflow file, we can automate the process of check out source, make build, signing process and submit ipa to test flight.

When you go through the above link, you may face some issues

To see our actions working or not, you will get mail form GitHub if any failure, or you can look at the  repositories' 'Actions' (4th) tab. first is 'Code' tab.

Don't forget to set read/write permission for the script file (.sh files)

---Update 1

If you need to update your build number automatically, then use

Sunday, March 18, 2018

Swift Code Review

When we work on a project as team, we want to make sure all of team members follow some rules

- to keep good coding practice
- to maintain the code looks similar
- to reduce bugs
- to improve performance

One of the best way to follow good swift styles is using Swift Lint

Here are some other tips for code review:

1.
Reduce the use of red text. We have to keep an eye on the text with red colour ( I am mentioning the Xcode default format).
The only text in red colour should be the key in Localizable.strings file or some print statements.

2.

Reduce the usage of 'self.'
The only place 'self.'  can exist should the init() or constructors of a class.
If we forced to use self in any closures, then apply [weak self] for the arguments and add a guard statement. Check below example:

CameraController.requestCameraAccess(completion: { [weak self] (status) in
  guard let strongSelf = self else { return }
  if status {
    globalMainQueue.async {
      strongSelf.performRoomSelection(model: model, cellIndex: cellIndex)
    }
  }
})

3. Reduce the usage of integer or string constants.

group it using enum if possible.

4. Inherit NSObject only if necessary.

5. Check all delegate vars are declared as 'weak'

Tuesday, December 12, 2017

Convert Localizable.strings to a spread sheet or csv / xls file


"label.welcome" = "Welcome";//welcome message in splash screen


1. Rename the Localizable.strings file to Localizable.csv and open it in OpenOffice.

2. Give the separator as “=“ and //

Then we can save as it in our format such as .xls

Wednesday, April 17, 2013

Xcode 4.6.2 - PCH file built from a different branch

After updating Xcode 4.6.2, got error like

error: PCH file built from a different branch ((clang-425.0.27)) than the compiler ((clang-425.0.28)) xcode 4.6.2

After do a Clean (Product -> Clean) its disappeared :)

Thursday, November 8, 2012

application executable is missing a required architecture. At least one of the following architecture must be present armv6

Getting this error when submit a universal application.
"application executable is missing a required architecture. At least one of the following architecture must be present armv6"

The issue was with changes in Xcode 4.5.x for ios 6
Its minimum supported os version is 4.3
So we have to set the Deployment Target = 4.3 or greater. 

Friday, November 2, 2012

Xcode : iPad mini simulator

The 'iPad mini' has the resolution of iPad which is 1024 x 768.

 iPad mini does not have a Retina Display. It has greater pixel density. But the pixel density is not  good as Retina Display

So we can use the Device Simulator labeled as 'iPad' for testing 'iPad mini'

Wednesday, October 31, 2012

unsupported architecture armv7 - Xcode 4.5

Got this error when try to submit universal application

On Build Settings, The Architectures are:

$(ARCHS_STANDARD_32_BIT)
armv6

Its fixed when change the value of "Build Active Architecture Only"

Build Active Architecture Only = Yes

Monday, October 22, 2012

-bash: svn: command not found - After Mountain Lion update

To install the command line tools
Xcode Menu, Go to preferences , In the Download tab, click to install Command line tools.