bool compareVersion({required String appVersion, required String compareVersion}) {
  bool isNeedUpdate = false;
  List<String> arrX = appVersion.split(".");
  List<String> arrY = compareVersion.split(".");

  int length = max(arrX.length, arrY.length);

  for (int i = 0; i < length; i++) {
    int x, y;

    try {
      x = int.parse(arrX[i]);
    } on Exception {
      x = 0;
    }

    try {
      y = int.parse(arrY[i]);
    } on Exception {
      y = 0;
    }

    if (x > y) {
      //앱버전이큼
      isNeedUpdate = false;
      break;
    } else if (x < y) {
      //비교버전이큼
      isNeedUpdate = true;
      break;
    } else {
      //동일
      isNeedUpdate = false;
    }
  }

  return isNeedUpdate;
}
반응형

mac에서 터미널을 켠 후 

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

각각 실행 후 

flutter doctor 실행하면 인식된다!

혹시 안된다면 핸드폰 재부팅하면 된다

 

인식은되는데

no devices found with name or id matching 에러가 뜬다면

 

flutter doctor -v  실행

Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.

 

위같은 에러가 뜬다면 핸드폰 재부팅하면 잘된다 

 

추가:

빈번하게 연결잘하고쓰다가 갑자기 안되고 하는데

xcode를 켜놓고 빌드,

선을 다시 꼽아서 빼보고 빌드 ,

앱을 지웠다가 다시 빌드,

안되면 폰을 재부팅,

하면 왠만하면 해결

 

 

참고:https://stackoverflow.com/questions/64303314/flutter-ios-cant-detect-connected-ios-simulator

반응형

'flutter > ios' 카테고리의 다른 글

adb command not found  (0) 2023.02.02
Xcode doesn’t support iPhone’s iOS  (0) 2022.09.22
ios appstore reject 10번이상 리젝맞은 사유 모음  (0) 2021.10.15
수출 규정 관련 문서가 누락됨  (0) 2021.10.12
ios udid 확인방법  (0) 2021.10.05

yaml에 추가 

intl: ^0.17.0

https://pub.dev/packages/intl

 

 

var m = NumberFormat.currency(locale: "ko_KR", symbol: "₩"); 
print(m.format(1000000000000));
//₩1,000,000,000,000

symbol 없으면 나라별단위로 나옴 (ex:KRW)

 

반응형

'flutter > study' 카테고리의 다른 글

firebase dynamiclink 만들기  (0) 2023.03.03
google map 연동  (0) 2022.09.25
flutter 현지화  (0) 2021.07.28
TextField 사용시 바깥부분 터치시 focus 잃게하는방법  (0) 2021.07.28
app 이름 변경  (0) 2021.07.21

+ Recent posts