I have been struggling to get my iOS ionic project to build and deploy properly, so I have created a simple base project:
ionic start barcode-test --v2
This creates a simple ionic application shell with three tabs. I’ve installed one plugin:
ionic plugin add phonegap-plugin-barcodescanner
I created a yml file:
## Customize the test machine
machine:
timezone:
America/Denver # Set the timezone
environment:
XCODE_SCHEME: symbolicator
XCODE_WORKSPACE: symbolicator
## Customize dependencies
dependencies:
pre:
- npm install -g typescript typings ionic cordova ios-sim ios-deploy
- typings install
- gem install fastlane -v 2.2.0
post:
- ionic platform add ios
## customize test commands
test:
override:
- ionic build ios
deployment:
beta_distribution:
branch: 'develop'
commands:
- fastlane ios beta build_number:$CIRCLE_BUILD_NUM
- cp -R ./dist $CIRCLE_ARTIFACTS
I committed my code: https://github.com/briebugconsulting/barcode-test
I’ve made this branch public in hope that it can help others experiencing similar issues. I’m hoping that this can become part of the base documentation for the circleci when its all done.
Note: I have not included the platforms folders as this is not part of the actual source code.
The goals for this build include:
- Build on OSX platform
- Not complain about xcode scheme/workspace/project environmental variables.
- should install iOS and Android platforms
- install android sdk
- install fastlane
- deploy to test flight
- deploy to google play beta testing
When the build runs it fails to add the platform:
ionic platform add ios
function bold() { [native code] } https://github.com/driftyco/ionic-default-resources/archive/master.zip
Error: Current working directory is not a Cordova-based project.
I’m guessing this probably caused by using symbolicator in the environment section:
environment:
XCODE_SCHEME: symbolicator
XCODE_WORKSPACE: symbolicator
I saw someone else using symbolicator and it seemed to get me past the issue of not having a workspace or project to point at when the build is first started. I can ssh into the machine and run the same commands to add the platforms, and of course it works without issue.
Any ideas how how to make this work? I have checked in the entire platforms project folder in other projects, however, this seems so wrong and bloats the project unnecessarily. I just need to delay setting where the workspace/project folders will be until I can add the platforms. If I can get this to work then I believe the rest of it will be pretty simple as we have been able to build successfully to testflight with other projects.