Migrating Ionic project written in Windows to MacOS - ios

I have an Ionic project. I wrote and compiled it for Android on Windows. My project is running on Android. But I don't know how to compile the project on Mac. I installed XCode. I copied
../platform/ios
folder to Mac.
I open the project. I get the error:
"Couldn't load project" "The file couldn't be opened".
How can I open the project in Xcode? Thanks.

You need to copy whole project on Mac. Then add iOS platform to it, and then you can open it in Xcode.
This guide covers how to run and debug Ionic apps on iOS simulators and devices using Capacitor or Cordova. iOS apps can only be developed on macOS with Xcode installed.
Setting up a Development Team
All iOS apps must be code signed, even for development. Luckily, Xcode
makes this easy with automatic code signing. The only prerequisite is
an Apple ID.
Open Xcode and navigate to Xcode » Preferences » Accounts. Add an
Apple ID if none are listed. Once logged in, a Personal Team will
appear in the team list of the Apple ID.
Cordova Setup
The ios-sim and ios-deploy are utilities that deploy apps to
the iOS simulator and iOS devices during development. They can be
installed globally with npm. This section is not necessary for Capacitor.
$ npm install -g ios-sim
$ brew install ios-deploy

Related

Unable to deploy an Ionic Framework app on ios device

I'm developing an ionic framework app with Ionic 2. I can deploy via my MAC to an android device using 'ionic cordova run android'. But when I execute 'ionic cordova run ios' I get the following error:
Code Signing Error: Signing for "App" requires a development team. Select a development team in the project editor.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'
All of the online answers for this issue only mention signing provisions in xCode but I'm not sure how that would resolve an Ionic app created in Visual Code. I didn't do any development in xCode and it's only installed in order to use the emulator. The solutions say to open the app in xcode for the signing but you can't even open an Ionic app in xCode.
Could someone please help with this, I've had this issue for weeks with ios.
Open the .xcodeproj in xcode, go to the project settings, and under signing, use the team dropdown menu to select a dev team and remove the error. This error is occurring because to emulate an ios app, it has to be built using xcode.

Apache Cordova, Visual Studio 2015, Xcode 8.3 cannot remotebuild

It has been a year since I first build the app, and of course my iPhone software has updated since then. With that I was informed that I needed to update Xcode in order to get the right platform to get a release version for my cordova app updates. Updating xcode required me to update the OS to Sierra on the mac. After that, I have been unable to remotebuild even my debug version, which I had been able to do before.
My constant issue right now is that when I build the app in remote build it keeps adding "ios": "4.0.1" to the platforms.json file, but the error I receive is that with xcode 8.3 I need 4.3.0 or greater.
I cannot figure out how to update this value. I have upgraded npm, node, everything that I can think of. Nothing changes the value, and I can't seem to find anyone else with my problem.
Any help or suggestions would be welcome.
First, open up project platforms folder and delete ios folder. Then update cordova on your development machine and Mac.
For Mac : $ sudo npm install -g cordova
For Windows: npm install -g cordova
Just check whether your files getting deployed to the Mac build folder path. If so, open up the project using XCode.
Then build your project using XCODE. Most probably there will be an error to choose the development team. Once you select the account or the team fom dropdown list you can deploy the app without any issues.
That worked for me. Hope this will help you too.
Another way: Navigate to platforms folder -> platforms.json. Check the IOS version. Change it to 4.3.0 and delete the ios folder and add IOS 4.3.0 via command prompt.
packages.json
{
"android": "5.1.1",
"ios": "4.3.0"
}
in cmd Run
cordova platform add ios#4.3.0
Well, be ready for many actions to be done but in the end it works. )
Update your XCode to 8.3.3 without worry.
Then be sure to update your remotebuild to the latest version that is currently 2.1.3 by running sudo npm i remotebuild -g on your Mac.
Get back to your development machine with Visual Studio and run some command line utility in administrator mode. Open you cordova folder from there.
Execute cordova platform rm ios to remove the current ios version under cordova. It's also advised to remove the android one by cordova platform rm android.
Update the version of CLI you use for builidng on Visual Studio. Currently it's 7.0.1. There were people that claimed that 6.5.0 also works but in my setup 7.0.1 works as well.
Get back to your command line and run cordova platform add ios#4.4.0, This is the minimal cordova ios that supports the cordova 7.0.1.
In case you removed android as well then run cordova platform add android#6.0.0. There are more progressive versions of cordova android but I found them not working.
Now get back to your Mac and remove the following folder ~/.taco-remote/node_modules.
In case you don't see this .taco-remote folder it's the hidden one so run in command line of your Mac com.apple.Finder AppleShowAllFiles true and then killall Finder to close all instances of Finder. Afterwards .taco-remote folder should be visible under your user folder ~/.
Now go back to Visual Studio and open Tools > Options > Tools for Apache Cordova and run Clear Cordova cache.
Now run your ios and it should succeed.
In case you run afterwards your android build and it fails on something like Android platform already added run the Clear cordova cache again and then your android build also should succeed.
From this point both ios and android builds should work.
Whooof. )
Good luck!
BTW, most of this solution came from this thread.

iOS package for iPad freezes while installing in device

I have developed an app targeting windows and iOS. The windows build works perfectly while installing on device but not the iOS app.
I am using a Visual Studio 2015 on my windows 8.1 PC and have a MAC connected remotely. I have specified iOS version 9.0 in config.xml file. It successfully creates release builds for iOS by generating a .ipa file.
When I put this file in my mac system, connect my iPad air with version 9.02 and try to install the app on device with itunes, the status says installing but then freezes. It never completes installing the app completely.
FYI- The provisioning file I have used for it is an AD-HOC provisioning file. My device along with its UDID is registered in my apple developer account too.
What are the probable reasons for it? How can I correct it?
You can't install release build with itunes. Use debug build, and it will work.

How to install cordova(phonegap) ios app to device via cli and not via xcode

I am trying to create a simple project with last phonegap version:
$ phonegap create my-project
$ phonegap build ios
$ phonegap install ios
All works perfectly and I see emulator with my simple application.
But I can't find documentation on how to run my application on device(iphone, for example) and not on a simulator.
All documentation by cordova / phonegap based on examples with cordova's template for xcode.
But last cordova's version don't have template for xcode and all that I need - cli, if I understand correctly?
I already registered as IOS developer and I have a valid iPhone development certificate.
When I connect my device - I can see it in xcode and I can run native application on my device.
But only via xcode.
I will be grateful to any advice.
If the cordova app builds and runs on the simulator, try running cordova run ios --device
This worked for me, when before it was only hitting the simulator.
Alternatively, if that STILL doesn't work for you, when you run codova build ios, to just build the app, you could use itunes to sync the generated .app file in <project_folder>/platforms/ios/build/device/AppName.app
There is an Apple CLI tool canned xcodebuild, as well as this wrapper around it by Facebook. I'd suggest trying out either that or look at the build-in xcodebuild shipped with xcode.
Hopefully one of them will work.
https://github.com/facebook/xctool
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
If you use Cordova CLI, you should be able to do this:
cordova run ios

Dreamweaver + PhoneGap + Xcode App build nightmare

The issue is that I cannot now successfully build my Dreamweaver + PhoneGap App in Xcode for release in the iTunes App Store.
Background - I have been building an app using Dreamweaver and the built-in PhoneGap. To start with everything was working, including the emulator which started via Dreamweaver and the Xcode build. I have an early version of the app running on my iPhone right now with no problem.
After installing Lion on release, I started to encounter problems in that the App would not start in the emulator straight from Dreamweaver, but produced a fail message. However it did make an App bundle which could then be opened from Xcode itself. That was fine, but unfortunately now the App will not build or run at all in the emulator or my 'phone, which seems to stem from me doing a Clean in Xcode which I haven't done for a while. Very frustrating as it has been 3 months work and I was just about to release it on iTunes.I would be really grateful for ideas - the full buildlog.log is here http://bit.ly/tbYzVU
You may notice in your build log the following error on Line 39, which appears many times in your log:
ERROR: The requested SDK ("4.3") is not installed.
The version of PhoneGap you're using in Dreamweaver is looking for the iOS 4.3 Simulator at:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk
However, when upgrading to Mac OS X 10.7 "Lion" and presumably installing Xcode 4.2 from the AppStore, you probably only have the iOS 5 SDK. From the Xcode release notes:
What's New in Version 4.2.1
Features and enhancements in previous Xcode updates:
Xcode 4.2 includes SDKs for Mac OS X 10.7 Lion and iOS 5.
To verify what SDKs (Software Developer Kits) you have on your computer, open the following directory in the Finder:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
It's likely that all you need to do is adjust which SDK Dreamweaver is targeting when building or emulating your app.
In your situation, you'll want to change your Site/App's SDK from iOS 4 to iOS 5.
From the Dreamweaver Help section for Packaging Web Applications, refer to Creating an Application Package (Mac OS):
Select Site > Mobile Applications > Configure Application Framework
Confirm iOS Developer Tools Path is configured to /Developer
Select Site > Mobile Applications > Application Settings
Under Select Target OS Version, for "iPhone/iPod Touch/iPad, choose 5.0
Build your App using Site > Mobile Applications > Emulate and Build

Resources