Skip to content

Instantly share code, notes, and snippets.


Hao Wu wuhao5

  • Mountain View, CA
View GitHub Profile
wuhao5 / background.rb
Last active Jan 4, 2016
Appium UIA iOS 9.x workaround for backgrouding app
View background.rb
#!/usr/bin/env ruby
require "appium_lib"
def desired_caps
caps: {
platformName: 'iOS',
View os x yosemite dmg
1. Download Yosemite from the App Store (or your favorite digital content distribution warehouse)
2. Open terminal
3. Run "gem install iesd"
4. Run "iesd -i /Applications/Install\ OS\ X\ 10.10\ Developer\ -o yosemite.dmg -t BaseSystem"
Adding additional steps because certain files end up missing from above:
5. Run "hdiutil convert yosemite.dmg -format UDSP -o yosemite.sparseimage"
6. Run "hdiutil mount /Applications/Install\ OS\ X\ 10.10\ Developer\"
7. Run "hdiutil mount yosemite.sparseimage"
8. Run "cp /Volumes/OS\ X\ Install\ ESD/BaseSystem.* /Volumes/OS\ X\ Base\ System/"
View os x mavericks dmg
# ==============================================================
# 10.9. Make an ISO from the
# ==============================================================
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to 8GB to accommodate the packages
wuhao5 / wxlua-clang
Created Aug 6, 2014
wxLua cmake config for Clang and C++11
View wxlua-clang
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_C_COMPILER=`xcrun -f clang` -DCMAKE_CXX_COMPILER=`xcrun -f clang++` -DwxWidgets_CONFIG_EXECUTABLE=../../../wxWidgets/install/bin/wx-config -DwxWidgets_COMPONENTS="stc;html;aui;adv;core;net;base" -DwxLuaBind_COMPONENTS="stc;html;aui;adv;core;net;base" -DwxLua_LUA_LIBRARY_USE_BUILTIN=FALSE -DwxLua_LUA_LIBRARY_VERSION=5.2 -DBUILD_USE_PRECOMPILED_HEADERS=FALSE -DCMAKE_CXX_FLAGS='-std=c++11 -stdlib=libc++ -Wno-c++11-narrowing' -DwxLua_LUA_LIBRARY_USE_BUILTIN=TRUE -DwxLua_LUA_LIBRARY_BUILD_SHARED=TRUE
wuhao5 / wxwidget-clang
Last active Aug 29, 2015
wxWidget configure for Clang and C++11
View wxwidget-clang
./configure --prefix=`pwd`/install CC=clang CXX=clang++ CXXCPP="clang++ -E -std=c++11" --with-macosx-sdk=`xcrun --show-sdk-path` --enable-stl --with-expat=no --enable-unicode --with-osx_cocoa CFLAGS="-Os" CXXFLAGS="-Os -stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++ -flto" CPP="clang -E" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=no --with-expat=no --with-zlib=builtin --disable-richtext --with-cocoa -with-macosx-version-min=10.7 --enable-compat28
mkdir -p lib
mkdir -p include
xcodebuild -target Box2D -sdk iphoneos -project Build/xcode5/Box2D.xcodeproj/ -configuration=Release -arch armv6 -arch armv7 -arch armv7s
xcodebuild -target Box2D -sdk iphonesimulator -project Build/xcode5/Box2D.xcodeproj/ -configuration=Release
lipo -create Build/xcode5/build/Release-iphoneos/libBox2D.a Build/xcode5/build/Release-iphonesimulator/libBox2D.a -o lib/libBox2D.a
find Box2D -name "*.h" -type f | while read line; do DIRNAME=`dirname $line`; mkdir -p include/$DIRNAME; cp $line include/$DIRNAME/.; done;
wuhao5 /
Last active Dec 1, 2019
build libpng for iOS/MacOS X
rm -rf install_*
rm -rf output-*
# build simulator
./configure --prefix=`pwd`/install_i386 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch i386"
make clean && make -j8 && make install
./configure --prefix=`pwd`/install_x86_64 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch x86_64"
make clean && make -j8 && make install