Is there a way to get a blank xcworkspace to work with gym through cli? - fastlane

If I want to have a clean cordova build, I'm not supposed to include the ios platform, instead it gets generated on the build server together with everything else.
I can generate xcworkspace via xcode on CI. But is there some way of configuring xcode over cli like here: https://docs.fastlane.tools/codesigning/XcodeProject/#setting-up-your-xcode-project?

I had the same issue, so I ended up creating a Fastlane plugin for Cordova to solve this.
See how to use it in this blog post or below:
Use the Cordova Fastlane plugin
Add the Cordova Fastlane Plugin to your project:
fastlane add_plugin cordova
When asked Should fastlane modify the Gemfile at path 'Gemfile' for you? (y/n), reply with y.
Then you can integrate the plugin into your Fastlane setup, for example:
platform :ios do
desc "Deploy ios app on the appstore"
lane :create do
produce(app_name: "myapp")
end
lane :deploy do
match(
type: "appstore",
git_url: "https://bitbucket.org/Almouro/certificates" # REPLACE WITH YOUR PRIVATE REPO FOR MATCH
)
cordova(platform: 'ios') # Using the Cordova Fastlane Plugin
appstore(ipa: ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'])
end
end
platform :android do
desc "Deploy android app on play store"
lane :deploy do
cordova(
platform: 'android',
keystore_path: './prod.keystore', # REPLACE THESE LINES WITH YOUR KEYSTORE INFORMATION
keystore_alias: 'prod',
keystore_password: 'password'
) # Cordova Fastlane Plugin
supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
end
end
with an Appfile such as
app_identifier "com.awesome.app"
apple_id "apple#id.com"
team_id "28323HT"
Piece of cake now!
For iOS, run fastlane ios create once to create your app on the developer member center and iTunes Connect.
Now, you only have to run fastlane ios deploy and fastlane android deploy to deploy to the stores!
Where to go from here
You can see all the plugin options by running fastlane actions cordova at the root of your Cordova app
If you have any issue or idea for improvement on the plugin, please make them know here

Related

No podspec found for `package` when adding iOS project to existing Ionic 5 project

I built a Capacitor plugin for Ionic and Capacitor and published it to NPM - call it test1. I then use it in my Ionic 5 project and successfully add a new Android project via:
ionic build
ionic cap add android
ionic cap sync
Tested it and it works. I then try and add an iOS via:
ionic build
ionic cap add ios
I then get the following error:
`[!] No podspec found for `Test1` in `../../node_modules/test1```
And it fails. I can't figure out why as there is a Test1Plugin.podspec file in the root with relevant dependencies and an ios/Podfile with relevant dependencies. I also ensure both files are published to npm.
I tried changing the name of the .podspec file to Test1.podspec but it's the exact same issue.
I'm pretty stumped and hoping someone has some pointers as i've been on this for a while and tried everything.

how to do prod build in ionic capacitor

In ionic 4, how to do a release aka prod build?
The angular part can be build in prod mode by ionic build --prod
Now how to copy this build to android? If I do ionic capacitor run android it will do normal build first and then copy assets to android. But I want to build in prod mode and take assets to android.
(I know how to generate apk in Android studio)
After doing
ionic build --prod
Assuming you have already installed Capacitor, otherwise you can follow this and thereafter,
You can do the following
npx cap copy android
Which copies the built code to android folder.
Then you can do
npx cap open android
Which opens android studio if you havent opened it already, then you should go to Build -> Generate Signed Bundle / APK option and the rest is quite straightforward.
More info can be found here
You can use the simple way.
ionic capacitor build android --prod
after the command, the android studio will open automatic
Development:
android stdio: Build-> Build Bundle(s)/APK(s)->Build APk(s)
Production: android stdio: Build-> Generate Signed Bundle(s)/APK(s)-> Android App Bundle or APk-> release

bitrise could not find transporter at Applications/Xcode-beta.app/Contents/Developer

I am trying to upload ios archive to testflight using bitrise and fastlane but after archive success I get the error "Could not find transporter at Applications/Xcode-beta.app/Contents/Developer" and the workflow fails.
Here is my fastlane file
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
increment_build_number(xcodeproj: "APPNAME.xcodeproj")
match(type: "appstore")
cocoapods
build_app(workspace: "APPNAME.xcworkspace", scheme: "APPNAME")
upload_to_testflight
commit_version_bump(
message: "Fastlane iOS: Released new build #{lane_context[SharedValues::BUILD_NUMBER]} [ci skip].",
xcodeproj: "./APPNAME.xcodeproj",
force: true
)
clean_build_artifacts
end
end
Xcode 11 doesn't include the Transporter application anymore.
https://developer.apple.com/videos/play/wwdc2019/301/
I first got this error and so I downloaded Transporter off the apple help page. However, Transporter 2x is not compatible with xcode 11. You need to use the version that is bundled with xcode 10x.
This github thread contains a download link to the appropriate binary.
If you have already installed the incorrect version of Transporter in the default path that fastlane expects /usr/local/itms, then use the environment variable FASTLANE_ITUNES_TRANSPORTER_PATH to specify a path to iTMSTransporter.cmd.
Specifying this path solved my issue and I was able to release to the apple store with xcode 11.

how to resolve installation problem in device ionic 4

I'm trying install .APK in my divece but I get the following error "app was not installed", I'm using ionic v 4 and my divece is android 6.0.1, any idea ?
Use this command for V4 :
ionic cordova build --release android
This will generate unsigned apk file under
platforms/android/build/outputs/apk/your-project-name.apk
And simply download apk file to your phone and install it. More details can be found here
I faced this error before and the cause was that using unsigned APK or the device contains app with same "App Id"
So to Solve it, Please Follow this instructions:
Use this Command
ionic cordova build android --prod
Then Try to remove any other apps from your phone that may have same app id (any old versions or sample apps) or change your app id from config.xml (before build of course)
<widget id="com.android.YOUR_UNIQE_APP_ID" ... >

Tasks for production prepared Ionic app

I'm trying to figure out what's the best process to pass from the code to the final deployable apk/ipa.
So far I have a testsuite using Karma + Jasmine, which transpiles the TypeScript to JS and runs some unit tests. I start that process via gulp.
After that all I know is to ionic build android --release what generates (an unsigned yet) apk.
But I'm not sure of how ofuscated/minificated the generated apk is.
So, keeping in mind the code has to be as private as possible, is the minification and the ofuscation of the ionic build enough or should I do all those prebuild tasks manually via gulp?
And in that case, whats are the right tasks I should run, do I have to transpile all the TypeScript files to JS manually? and in what order should I run the tasks?
E.g. transpile -> tests -> minify -> uglify -> build apk or minify -> uglify -> transpile -> tests -> build apk
I'm a bit lost with this, and the only thing I can figure out is that the tests should be ran first, because is case of test failure the process should be aborted.
Try ionic-app-scripts >= 0.0.48 to config build.
Production:
ionic build android --prod
To check the minified file, open the apk file with GNOME Archive Manager (or similiar) and extract /assets/www/build/js/app.bundle.js file.
Preparing an Ionic Cordova app for release in production
1. Building
In your terminal execute the following command according to your platform (android / ios):
ionic build android --prod --release
2. Releasing
In order to be able to install a production application on a device and furthermore in order to be able to publish it in app stores, your .apk or .ipa
file needs to be signed. How you do that depends on the platform.
Here is the procedure in detail for Android and for iOS.
Preparing an Ionic Progressive Web App (PWA) for release in production
1. Building
In your package.json file, you should make sure to have something like the following:
"scripts": {
// ...
"build:www": "rm -rf www && ionic-app-scripts build --prod",
// ...
},
Now in your terminal run:
npm run build:www
2. Releasing
Your app is built in the folder www ready for you to serve in production using any webserver like NginX, Apache or a custom Node + Express webserver.
Valid as of Ionic v3.3
Learn more about ionic-scripts, what they do and which other scripts you could possibly find useful.