How can I code sign an Ionic app using Bitrise - ionic-framework

I'm using Bitrise to build an Ionic app. How can I easily do the complicated code signing part for apple developer so the app can be deployed to iOS?

Add Your Apple ID to Xcode
Start Xcode
Click Xcode > Preferences
At the top of the window select Accounts.
Click on the + on the lower left corner and select Add Apple ID...
A dialog will appear. Add your Apple ID and your password, then select Sign in.
(If you don't have an account you can create an Apple ID by selecting Create Apple ID)
Export your Apple ID Certificates
Click Xcode > Preferences
Select your Apple ID and your team
Click Manage Certificates
Right-Click on each certificate and click Export Certificate
Create an Xcode app by adding the platform to the Ionic project
Clone your Ionic app
Open your cloned project folder in terminal
Run ionic cordova platform add ios
After the platform is added go to the project folder, then: platforms/ios/PROJECTNAME.xcodeproj
Double click on the project to open it in Xcode
Create an AppID with Apple
Go to: https://developer.apple.com/account/ios/identifier/bundle
Create a new App
Restart Xcode
Click on the Top-Level Project Name in Xcode
In the 'Signing' section click on 'Team' and choose a team
Create a Provisioning Profile with Apple
Go to: https://developer.apple.com/account/ios/profile/create
Create a Provisioning Profile
Download Provisioning Profile with Xcode
Select Xcode > Preferences menu.
At the top of the window select Accounts.
Select your Apple ID and your team, then select Download Manual Profiles.
Go to ~/Library/MobileDevice/Provisioning Profiles/ and your profiles should be there.

Worth to mention that once you generate the Xcode project (ionic cordova platform add ios) it's possible to use all the other bitrise.io features designed to use that, e.g. the "iOS Auto Provisioning" one which updates the prov profiles automatically after an apple dev login: https://blog.bitrise.io/ios-auto-provision-step

Related

How can I select a provisioning profile in the VS Code Titanium extension?

I am using the Titanium extension in VS Code, and I would like to know how I can select the provisioning profile when I want to build my project to my connected device.
I click on titanium icon on left panel, in build->ios->device->mydevice I click on the icon like "play" to build, a popup appears to ask to me to select provisioning profile, but I don't know how to do that. I don't have a selector to do it or something else to indicate the asked file.
If you have profiles installed on your system that match the bundle id it will show them in the drop down.
You could also run ti build -p ios --target dist-appstore in the app folder and see if it will show you the profiles in the CLI menu

It appears that your application still contains the default signing identifier

The flutter app was working completely fine. After few days when i tried to run in ios device it said like this "open xcode and try product -> run and try fixing it . After doing this and still showed me the same error".
Product -> run ,
flutter clean ,
flutter packages get ,
open ios/Runner.xcworkspace ,
signing in General(target) ->select team
If anyone had their app running before and faced this error, what worked for me was (note I am using a Macbook pro), was to open up the terminal first.
Then navigate to the project folder and typing in open ios/Runner.xcworkspace.
This command will open up your xcode. From there you can select you device on the top (emulator or physical ios device), and click on run.
Once it builds and runs successfully, it will fix the issue you are facing, now you can go to VS code or android studio and try flutter run and it should work.
If you see this error when trying to run your app on your iPhone for the first time, it's because your xCode signing identifier contains a default one and needs updating.
Here's how to solved this issue:
In VsCode, right click the ios folder and click Xcode.
In XCode, click Runner , The top option on the left then 'Signing & Capabilities'
Click 'Automatically manage signing'
Select your Team, if you don't have one setup, click 'Add an account' and continue to the next step.
Select "Add your Apple ID"
Click Manage Certificates then click the '+' button located in the corner , then click 'Apple Development' to add a signing certificate.
Click Done. Signing Certificate should display 'Apple Development: yourAppleID..."
Select your connected iPhone from the build destination dropdown - see screenshot
Click the big play button to run the build in xCode
Trust your iPhone - Open your iPhone settings > General > Device Management or VPN & Device Management > Under Developer APP, select Apple Development : your appleID > Click Trust "Apple Development: "your apple id...."
Open vsCode and run flutter clean && flutter run.
To Fellow up with Harsh, if you have no paid Apple Developer license, your certificate runs out after a week.
In my case, I needed again to trust my developer certificate on my iPhone, again. Before that, I also received your error. If you open up your app with Xcode, you will see the real error message.
Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner')
You are encountering this error because com.example hasn't been registered as a Bundle ID on your developer account. I encountered this error while trying to use platform methods. I rectified the issue by creating a new Bundle ID on my Apple Developer Account - something like com.abc.appName. Here, abc is the name of my company. And then created a new project with this Bundle ID. Open up Xcode and under Runner -> Runner Target -> Signing and Capabilities add your Team name and make sure the automatically manage signing option is turned on
My issue was that I added the exclusion of arm64 in Xcode because my simulator was not running due to some dependency (google map?). When i deleted this arm64 exclusion for ios sdk (left it for simulator) inside xcode, runner, build settings, excluded architecture. The app could run again on physical device.
The default signing identifier is com.example.
Sounds like you haven't changed it.

How to select Development team for iOS app created in Flutter

I am trying to deploy an iOS app to Device using Google's Flutter, but I get this error on the command line:
Building an iOS app requires a selected Development Team with a Provisioning Profile
Please ensure that a Development Team is selected by:
1- Opening the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected
For more information, please visit:
https://flutter.io/setup/#deploy-to-ios-devices
Or run on an iOS simulator
Where and how do I do this? There is no "ios/Runner.xcworkspace" in the project. I know the installed Certificates and Provisioning profile work on my Mac, because I created and installed an app on my iOS device using Appcelerator, and it found everything I needed, and ran perfectly on device.
Select Runner, and navigate to Signing & Capabilities, under Signing, check Automatically manage signing, after that choose a Team from the list, and you're done.
You have to sign in with your appleID at 'signing'. After that you can select your 'personal team'.
open ios/Runner.xcodeproj and follow the same instructions should work? Runner.xcodeworkspace is a relatively new addition to the template, created to allow Flutter projects to integrate better with CocoaPods.
If that doesn't work, please let us know.

Installing Developed Application into iphone device

Can anybody help me to install my developed app into an device.
what are the steps to execute my application in device.
how can i connect the device to run my application in device????
Please help me out.
Thank you..
Creating ad-hoc distribution profiles
The instructions that Apple provides are not very concise or clear. This is how I created a general provisioning profile that will work with multiple apps, and added a beta tester.
My setup:
Before you get started, make sure that..
You can run the app on your own iPhone through Xcode.
Step A: Add devices to the Provisioning Portal
Send an email to each beta tester with the following message:
To get my app on onto your iPhone I need some information about your phone. Guess what, there is an app for that!
Click on the below link and install and then run the app.
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=285691333&mt=8
This app will create an email. Please send it to me.
Collect all the UDIDs from your testers.
Go to the Provisioning Portal.
Go to the section Devices.
Click on the button Add Devices and add the devices previously collected.
Step B: Create a new provisioning profile
Start the Mac OS utility program Keychain Access.
In its main menu, select Keychain Access / Certificate Assistant / Request a Certificate From a Certificate Authority...
The dialog that pops up should aready have your email and name it it.
Select the radio button Saved to disk and Continue.
Save the file to disk.
Go back to the Provisioning Portal.
Go to the section Certificates.
Go to the tab Distribution.
Click the button Request Certificate.
Upload the file you created with Keychain Access: CertificateSigningRequest.certSigningRequest.
Click the button Aprove.
Refresh your browser until the status reads Issued.
Click the Download button and save the file distribution_identify.cer.
Doubleclick the file to add it to the Keychain.
Backup the certificate by selecting its private key and the File / Export Items....
Go back to the Provisioning Portal again.
Go to the section Provisioning.
Go to the tab Distribution.
Click the button New Profile.
Select the radio button Ad hoc.
Enter a profile name, I named mine Evertsson Common Ad Hoc.
Select the app id. I have a common app id to use for multiple apps: Evertsson Common.
Select the devices, in my case my own and my tester's.
Submit.
Refresh the browser until the status field reads Active.
Click the button Download and save the file to disk.
Doubleclick the file to add it to Xcode.
Step C: Build the app for distribution
Open your project in Xcode.
Open the Project Info pane: In Groups & Files select the topmost item and press Cmd+I.
Go to the tab Configuration.
Select the configuration Release.
Click the button Duplicate and name it Distribution.
Close the Project Info pane.
Open the Target Info pane: In Groups & Files expand Targets, select your target and press Cmd+I.
Go to the tab Build.
Select the Configuration named Distribution.
Find the section Code Signing.
Set the value of Code Signing Identity / Any iPhone OS Device to iPhone Distribution.
Close the Target Info pane.
In the main window select the Active Configuration to Distribution.
Create a new file from the file template Code Signing / Entitlements.
Name it Entitlements.plist.
In this file, uncheck the checkbox get-task-allow.
Bring up the Target Info pane, and find the section Code Signing again.
After Code Signing Entitlements enter the file name Entitlements.plist.
Save, clean, and build the project.
In Groups & Files find the folder MyApp / Products and expand it.
Right click the app and select Reveal in Finder.
Zip the .app file and the .mobileprovision file and send the archive to your tester.
Here is my app. To install it onto your phone:
Unzip the archive file.
Open iTunes.
Drag both files into iTunes and drop them on the Library group.
Sync your phone to install the app.
Done! Phew. This worked for me. So far I've only added one tester.
See Installing developed application into iPhone device
You will need a developers account, iTunes, a Mac computer, and the iPhone.
Follow this tutorial:
http://mobiforge.mobi/developing/story/deploying-iphone-apps-real-devices

Certificate in iPhone App

I'm working with iPhone application and i want put it in my iPhone.
In xcode there is a overview "device - 3.1.3 | debug" but when i "build and go" the project there is an certificate error.
I have download a certificate "mobileprovision" with a correct "Identifier" but i don't know how put it in my xcode project.
First, you need to have a subscription with apple to develop iPhone applications. I assume you do. That said, once you generate a certificate (through key chain) and upload it to the apple developers site, you can generate a provisioning profile and input the identifier of your iPhone: download that provisioning profile and installing it is as easy as dragging it to xcode. If everything matches, you can select device and build and go and it will download to your device
After downloading your provisioning profile on your mac, you first install it. Then check your installed profile in : admin/Library/MobileDevice/Provisioning Profiles folder. If it exists, it automatically attached to your xcode project. Open XCode> Window > Organizer > On left-side of Organizer, select "Provisioning Profiles" tab. There, you can find list of profiles you have.