Friday, May 26, 2017

How to remove CocoaPods from Xcode / iOS project? in 5 Simple steps

Removing pods setup from XCode Project
Sometimes we need to remove the whole CocoaPod from XCode / iOS Project. Due to some limitations
If you really want to remove all CocoaPods integration you need to do the following 5 steps:
  1. Delete the standalone files (Podfile Podfile.lock and your Pods directory)
  2. Delete the generated xcworkspace
  3. Open your xcodeproj file, delete the references to Pods.xcconfig and libPods.a (in the Frameworks group)
  4. Under your Build Phases delete the Copy Pods Resources, Embed Pods Frameworks and Check Pods Manifest.lock phases.
  5. This may seem obvious but you'll need to integrate the 3rd party libraries some other way or remove references to them from your code.
After those steps you should be set with a single xcodeproj that existed before you integrated CocoaPods.


Removing Cocoapods from our System
If you want to Remove Cocoapods from your system,
Anyway try to use the following command on your terminal to uninstall/remove the coca-pods from your system.
sudo gem uninstall cocoapod

Also Checkout Bellow link :
If I missed anything let me know and I will edit this.



Tuesday, May 16, 2017

How to setup Cocoapods in XCode for iOS Apps...? How to add third party Libraries using Cocoa pods in XCode

Setup Cocoapods : Open terminal and run this command to install Pods:


sudo gem install cocoapods


Enter admin password. This could take a few minutes of your time and then it will show green message "cocoapods installed successfully in your mac machine".
If you are getting any error with XCode 6 or later like developer path is missing. First run this command in terminal:


sudo xcode-select -switch /Applications/Xcode6.app (or your XCodeName.app)


If you still able to see same problem, you can do small hack like renaming the Xcode 6 to default. It is because terminal is not able to find path of your Xcode.


After running these commands you should have successfully installed CocoaPods in your mac machine. Now you can setup Pod with your Xcode project.


How to setup POD for your Xcode project:


1. Open Terminal


2. Change directory to your Xcode project root directory (where your ProjectName.xcodeproj file is placed).


Ex: cd "path of your project xcodeproj file" or Just drag and drop the project file into terminal.


3. $ pod setup : (Setting up CocoaPods master repo)
If successful, it will show : Setup completed (read-only access). So, you are ready now. Now lets install libraries in your Xcode project using Pods.


Steps to add/remove/update libraries in pod:


1. Open Terminal


2. Change directory to your Xcode project root directory (where your ProjectName.xcodeproj file is placed).


3. $ touch podfile (This will create a blank text file)


4. $ open -e podfile (This will open created blank text file)


5. Add your library names in that text file. platform :ios, '7.0' target 'Inspections' do pod 'AFNetworking', '~> 2.6.0' pod 'CocoaLumberjack', '~> 2.0.1' pod 'Crashlytics' pod 'Fabric' pod 'Flurry-iOS-SDK', '~> 7.1.1' pod 'skpsmtpmessage', '~> 0.0.1' pod 'ZipArchive', '~> 1.4.0' pod 'Localytics', '~> 3.8.0' end


NOTE: Use ( control + ” ) button to add single quote at both end of library name. It should be shown as straight vertical line. Without using control button it shall be added as curly single quote which will give error while installation of file.


6. Save and close this text file. Now libraries are setup and you have to install/update it.


7. Go to your terminal again and run this command: $ pod install (to install/update libraries in pod).


You should see output similar to the following:


Updating spec repo `master’
Installing “Library name” (1.2.2)..
Generating support files
After successful downloading/installation of any single library, It will generate ProjectName.xcworkspace in your project root directory. From now use this workspace to open your project. When you open your project work space you will see Pod is also added as another Xcode project with your Xcode project. If you open Pod it will show all libraries.


Libraries downloaded using Pod will only work only if you open workspace file.
For your next project you don’t need to install the cocoa pod again in your mac machine just open the terminal and setup the Pod in root directory of your Xcode project and always remember these 3 commands :
  • 1. $ touch podfile
  • 2. $ open -e podfile
  • 3. $ pod install
To update Pod libraries : $ pod update
To check POD version : $ pod –version


To update CocoaPods : $ gem install cocoapods or use sudo at start if getting error “You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.”

Thursday, May 4, 2017

Easy Steps for App Store Submission & Certificates creation

This guide contains all the steps required to properly submit an iOS app to the App Store.



Prerequisites:



Ensure that all app information and metadata is complete and accurate
Contact information in case App Review needs to reach us
An active demo account and login information, plus any other hardware or resources that might be needed to review your app (e.g. a sample QR code)
The following programs installed:
    1. Xcode
    2. Keychain Access
    3. Application Loader (opt)


Steps required for submitting an app:
  1. Assemble App Store Information
  2. Create a Bundle Identifier
  3. Create a Certificate Signing Request
  4. Create an App Store Production Certificate
  5. Create a Production Provisioning Profile
  6. Create an App Store Listing
  7. Create a Release Build
  8. Fill in the Version Information
  9. Submit Version for Review
  10. Release (Only for Manual release)



A. Assemble App Information:

It is very important to collect all of the information we need to submit before start the process.
Screenshots:
You need at least one for every supported device screen size.  The screenshots cannot contain transparency
Name:
Name of the app as seen by users
Description:
A description of your app, detailing features and functionality
Keywords:
Separate keywords with a comma
Support URL:
A URL with support information for your app
Marketing URL:
A URL with marketing information about your app, optional
Privacy Policy: URL:
A URL containing your app’s privacy policy, optional
App Icon:
This icon will be used on the App Store and must be in the JPG or PNG format, with a minimum resolution of at least 72 DPI, and in the RGB color space. It must not contain layers or rounded corners.
Categories:
Secondary category is optional
Rating:
Generate our rating based on the questionnaire  
Copyright:
Use the format: YYYY Company Name
Demo Account:
“The username and password for a full-access account for our app. Include details for additional accounts in the Notes field.”






B. Create a Bundle Identifier
The bundle identifier is the name of the app, as seen by both the App Store and iOS devices.
  1. In the browser, navigate to Apple’s Developer Portal
  2. Log in
  3. On the side menu, click Identifiers\App IDs:
  4. Click the “+” in the top right of the screen

3.png






  1. Name the App ID the same as our app
  2. Make sure the Bundle ID follows the standard naming convention: com.companyName.appName
  3. Check any App Services the app needs, click Continue
  4. Verify the services are correct, then click Submit.

4.png





C. Create a Certificate Signing Request

Certificate Signing Requests are used to link your computer to your Apple developer account.
  1. Open a program called KeyChain Access
  2. In the top left menu, click Certificate Assistant
  3. Click Request a Certificate From a Certificate Authority…

6.png










  1. User email: Enter your email address
  2. Common Name: We recommend using the name of the app
  3. CA email is not actually required
  4. Check Saved to Disk, click Continue
7.png
  1. Save the Certificate Signing Request for later on your finder.







D. Create an App Store Production Certificate

Code Signing Certificates are used to link iOS apps to your Apple developer account.
  1. In your browser, navigate to Apple’s Developer Portal
  2. Click Certificates
  3. Click the “+” in the top right of the screen
  4. Click the App Store Production
8.png
  1. Currently named “App Store and Ad Hoc” under Production
  2. Click Continue
  3. Upload the Certificate Signing Request created earlier
9.png
10.png
  1. Download the Certificate
11.png
  1. Install the certificate on your computer by double clicking
  2. Keep this file somewhere safe






E. Create a Production Provisioning Profile

Provisioning Profiles are packaged with iOS apps so users devices can install them.
  1. In your browser, navigate to Apple’s Developer Portal
  2. Log in
  3. Click Provisioning Profiles
  4. Click the “+” in the top right of the screen
  5. Click the App Store Distribution option, click Continue
15.png






  1. Select the Bundle ID created earlier, click Continue
14.png
  1. Select the Certificate created earlier, click Continue
  2. Make sure the Profile Name follows the standard naming convention: App Name App Store Distribution
  3. Click Generate
  4. Download it
  5. Install the provision profile on your computer by double clicking
  6. Keep this file somewhere safe

F. Create App Store Listing  in iTunes Connect

Reserve a slot in the App Store for your app for users to see.

  1. Start in your browser, navigate to iTunes Connect
  2. Log in
  3. Click My Apps

16.png

  1. Click the “+” in the top left of the screen
  2. Click “New iOS App”

17.png












  1. Bundle ID: choose the one created on Developer Portal
  2. For convenience, make the SKU match the Bundle ID created earlier
  3. Click Create to create the first version listing

diagram_620-446x500.png




G. Make the release build

Package the actual binary that users will be uploading to the store.
  1. Start Xcode
  2. Open the project or workspace
  3. Update the version and build numbers
  4. Open Build Settings
  5. Make sure All settings is selected
  6. Scroll to Code Signing
  7. Use the provisioning profile created earlier
  8. Use the code signing identity created earlier
  9. In the top menu, select Generic iOS Device as the build destination if no actual device is connected
  10. Menu, Project, Archive
  11. Click Distribute
  12. Sign in as your apple developer account
  13. Choose Build
  14. Submit to app store
  15. Wait for the confirmation









H. Fill In Version Information
Users will decide whether or not to install your app based on your store listing.
  1. Enter all of the information assembled in step 1

  1. Select the build you wish to tie to the version (Note: This usually appears 10-15 minutes after sending from Xcode)

18.png





  1. Fill in pricing information
19.png












4. Add screenshots for user reference and preview in the Prepare for submission tab Just below the Pricing and Availability.




20.png






Scroll down and complete the the description (this is what the users will see in the app store) and keywords.
21.png












Set the version number (should be the same as in your app’s Xcode project).
Fill out a copyright notice (generally just the release year and your name or your company’s name), a contact email and affiliated websites.
22.png

Scroll down to App Review Information. This section is designed to help the person who reviews and approves your app. The Notes can be used for details about your app that you want the reviewer to know about. For example, if users need to sign up at a website or even within the app in order to use it, provide some credentials here to make the reviewer’s job easier. Also, if your app requires special hardware, ensure that you explain that here too, and try to have a way for the reviewer to use the app without the hardware. Complete the contact information so that the reviewer can reach you to discuss things if they need to
23.png




Select the release type
Manual release – after the app is accepted, a Release button will appear
Automatic release – as soon as the app is accepted, it will be released

Finally, use the Version Release section to indicate when you want the app to be released. Since this is the first version, just leave the Automatically release this version option selected.

Now click Save
I. Submit Version for Review

Every app that is submitted to the store has to be reviewed by the Apple team before release.
When you’re ready to submit the app for App Review, iTunes Connect walks you through a final set of questions. Only users with the Admin, Technical, or App Manager role can submit apps for review.
After you provide app configuration information, as described in Creating an iTunes Connect Record for an App, and uploaded a build, as described in Uploading a Build for an App, you’re ready to choose a a build, validate your app information, and submit your app for review. Note that only users with the Admin, Technical, or App Manager role can submit apps for review.
If you’re submitting a new version of an existing app, see Replacing Your App with a New Version instead of reading this chapter.
Before you submit your app, you also have the option of having users test prerelease versions of your app. This step is described in TestFlight Beta Testing (Optional).
Choosing a Build
You can upload any number of builds for your app, and they will remain in Activity on the App Details page. (See Viewing Builds.) When you submit the app for App Review, only one build can be associated with the App Store version of the app you want to submit. The build, called the current build, is the one that will be submitted for App Review.
To choose a build to be the current build, follow these steps:
  1. Open the App Details page for the app, as described in Creating an iTunes Connect Record for an App.
  2. Under App Store, select the version for the platform you want to submit and scroll to the Build section.
  3. Click the plus sign to select a build. The plus sign appears only if you have uploaded builds and have not yet not selected a current build. If you have already selected a build, you can remove it if you want to select a new one. See Removing the Current Build.
  4. ../Art/9A-AddBuild_Annotated.png
  5. A list pops up containing all of the uploaded builds. Select the one you want to choose as the current build.
  6. ../Art/9A-SelectBuild_2x.png
  7. If an earlier version of your app became Ready for Sale in the App Store, then the list of builds includes only builds you have uploaded since then. For more detail on which builds are available for you to choose, see Viewing Builds.
  8. After you click Done, the build number appears in the Build section of Versions along with its upload date and time.
  9. Click Submit at the top of the page.




Waiting for Review:

After submitted the app status is changed to “waiting for review”
24.png





  1. Wait for approval
  2. This process usually takes 2-3 weeks for a new submission
  3. If your app was not approved, review the notes in the Resolution Center and make any necessary changes to the app or version information then resubmit

J. Release (Only for Manual release)

The final step.
  1. If you selected Manual release, click Release your app when ready
  2. Wait for the green “Ready for Sale” version status (This might take from 1 hour to 1 day after release)
  3. Search for your app on the App Store
  4. Celebrate!
When submitting a new version of your app, you will only have to repeat steps G through J.






Just FYI…
App Store Review Guidelines