Skip to content

Instantly share code, notes, and snippets.

@AshineRong
AshineRong / Apple_mobile_device_types.txt
Created November 21, 2022 07:15 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@AshineRong
AshineRong / scrcpy 快速上手.sh
Created November 17, 2022 10:54
scrcpy 快速上手
# https://github.com/Genymobile/scrcpy
# https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+
# 有线 链接:
scrcpy -S --push-target /sdcard/DCIM/Scrcpy_files
# 无线链接
# 1. 将设备插入计算机上的 USB 端口。
@AshineRong
AshineRong / 一键生成xcframework.txt
Created September 16, 2022 05:25
一键生成xcframework
echo "build begin"
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
CURRENTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $CURRENTDIR
SCHEME="<yourproject>"
#!/bin/bash
KconfigPath="/opt/rcdata/config"
KPWD=`echo $(cat .ENV | grep 'Kpwd' | awk -F '=' '{print $2}')`
ifconfig -l | xargs -n1 ipconfig getifaddr > $KconfigPath/real_ip.txt
real_ip=$(sed -n '1p' $KconfigPath/real_ip.txt)
record_ip=$(sed -n '1p' $KconfigPath/record_local_ip.txt)
#!/usr/bin/ruby
require 'mail'
MailPWD =`echo $(cat .ENV | grep 'mail_cer' | awk -F '=' '{print $2}')`
RealIP = `echo $(sed -n '1p' /opt/rcdata/config/real_ip.txt)`
puts "RealIP: #{RealIP}"
KFormMail="Jenkins<xxxxx@163.com>"
KToMail="xxx"

pod 添加好资源后,进行处理

0. brew install swiftgen 前提

1. 动态执行命令

swiftgen xcassets --templateName swift5 --output ./Classes/RCSKTVAsset.swift ./Assets/Images.xcassets --param bundle="RCSKTVBundle.sharedBundle" --param publicAccess=true --param enumName=RCSKTVAsset --param forceProvidesNamespaces=false

相关说:output 输入生成swift文件路径

@AshineRong
AshineRong / 批量修改git提交的作者和邮箱.sh
Created February 9, 2022 03:10
批量修改git提交作者和邮箱
#!/bin/sh
# 直接修改[XXX]中的变量为对应的值即可
# cd 到项目根目录
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
//调整tabBarItem的image和title位置
self.tabBarItem.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: y)
self.tabBarItem.imageInsets = UIEdgeInsets(top: x, left: 0, bottom: w, right: 0)
// 这里y为0时即系统title位置,y小于0时title上移,image上移时x小于0,x与w为相反数,image位置才会显示在中间。

生成Entitlements.plist

第三项很多教程说不用填,但是不填是无法自动生成的,会一直卡在entitlements generated这个步骤,无法生成。所以我们要自己生成entitlements.plist! 首先我们把要重签的 XXXX.ipa 解压后得到 Payload目录,然后终端 cd 到Payload目录下,执行以下命令:/usr/libexec/PlistBuddy -x -c "print :Entitlements " /dev/stdin <<< $(security cms -D -i XXXX.app/embedded.mobileprovision) > Entitlements.plist 其中 XXXX.app 是你要重签的 ipa的包名。生成的 entitlements.plist存放在Payload目录下,然后我们用 文本编辑或者 Xcode打开 plist 文件,修改里面的application-identifier 作者:红发_KVO 链接:https://www.jianshu.com/p/52deb349d5d1

@AshineRong
AshineRong / cocoapods master 重装setup_update.sh
Last active December 19, 2021 15:10
pod setup / pod update master
#!/bin/bash
# 科学代理的配置(可选)
function vm_proxy_on() {
export no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com;
export http_proxy=http://127.0.0.1:1087;
export https_proxy=$http_proxy;
export all_proxy=socks5://127.0.0.1:1087;
curl cip.cc
echo -e "\n"