misOrz

IT Tech & Life

xtool: build and deploy iOS apps without Xcode

Found this while looking into iOS build options: xtool is a cross-platform Xcode replacement — it builds a SwiftPM package into an iOS app on Linux, WSL, macOS, and Windows.

What it covers:

  • Build a SwiftPM package into an iOS app
  • Sign and install iOS apps (xtool install xxx.ipa, xtool devices, xtool launch)
  • Apple Developer Services via CLI (xtool auth, xtool ds) and as a library (XKit SwiftPM product)

Handy subcommands:

xtool new      # create a new xtool SwiftPM project
xtool dev      # build and run it (screenshot below: Ubuntu + VSCode → iPhone)
xtool devices  # list devices

Why I bookmarked it: my day-to-day dev machine is Linux/Android. If I ever want an iOS companion for my QRCode scan app without buying into the full Xcode workflow, this is the kind of tool that makes it plausible — SwiftPM in, signed ipa out, no Mac required (per its README).

Screenshot from the xtool repo (VSCode on Ubuntu running xtool dev → installing to an iPhone):

Screenshot of xtool running in VSCode on Ubuntu, installing to an iPhone


Reference: https://github.com/xtool-org/xtool

Fix TTS init failure on Xiaomi (MIUI): declare TTS_SERVICE in the AndroidManifest queries block

Symptom: In my QRCode scan app, TextToSpeech init failed on a Xiaomi phone (China MIUI ROM) — status=-1 for engine com.google.android.tts, completely silent. The same APK worked fine on a Realme phone.

What I ruled out first:

  • Media volume was on, in-app TTS toggle was on.
  • Xiaomi's "Text-to-speech output": preferred engine was Google TTS, language Chinese (Taiwan), and the system "Listen to an example" test played sound fine — the engine itself was healthy.
  • Explicitly specifying Google TTS and adding an engine fallback list both failed the same way (system default was already Google, nothing to fall back to).

Root cause: Android 11+ package visibility. Since API 30, an app cannot see — and therefore cannot bind — another app's service unless it declares the intent in <queries>. Google TTS is a third-party app providing a TTS service; without the declaration, binding the TTS engine is silently blocked and TextToSpeech init returns ERROR (-1). Some OEM ROMs (e.g. Realme) don't enforce this strictly, which is why the same APK worked there.

Fix — add to AndroidManifest.xml:

<queries>
    <intent>
        <action android:name="android.intent.action.TTS_SERVICE" />
    </intent>
</queries>

After adding this (shipped as v1.1), TTS worked on both Xiaomi and Realme.

Lesson: whenever your app binds a service provided by another app (TTS engine, etc.) on Android 11+, declare the matching <queries> entry — otherwise the bind fails silently on strict OEM ROMs.


 

Create VLANs in Linux

 

ip link add link eth0 name eth0.3001 type vlan id 3001

ip addr add 192.168.100.1/24 brd 192.168.100.255 dev eth0.3001

ip link set dev eth0.3001 up

ip -d addr show



Reference: https://www.baeldung.com/linux/vlans-create





Login as Root in Ubuntu GUI

GDM – GNOME Display Manager

/etc/pam.d/gdm-autologin

/etc/pam.d/gdm-password

註解掉 # auth required pam_succeed_if.so user != root quiet_success

sudo service gdm restart





How to connect hidden ssid on debian 11

root@LINUX:~# rfkill unblock wifi

root@LINUX:~# killall wpa_supplicant

root@LINUX:~# wpa_passphrase SSID-NAME Password > wpa.conf

root@LINUX:~# wpa_supplicant -i wlan0 -c wpa.conf -B

root@LINUX:~# dhclient wlan0





changed its 'Version' value from '11.5' to '11.8'

 N: Repository 'http://opensource.nchc.org.tw/debian bullseye InRelease' changed its 'Version' value from '11.5' to '11.8'


root@LINUX:~/tmp# apt-get update --allow-releaseinfo-change




Change root password using sed

1. Generate new root password & Su2Root

# openssl passwd -1 -salt root hello123

2. Replace first line in shadow file

# sed -i '1c root:$1$root$wrNKG1lgeNwlb0I1oJbR9/.:19613:0:99999:7:::' /etc/shadow